Skip to content

Commit e3a8ff9

Browse files
committed
Support Cython 3
1 parent 2ae98f9 commit e3a8ff9

File tree

7 files changed

+166
-154
lines changed

7 files changed

+166
-154
lines changed

cuda/cuda.pyx.in

Lines changed: 94 additions & 86 deletions
Large diffs are not rendered by default.

cuda/cudart.pxd.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ cdef class cudaGraphNodeParams:
21642164
Get memory address of class instance
21652165

21662166
"""
2167-
cdef ccudart.cudaGraphNodeParams __val
2167+
cdef ccudart.cudaGraphNodeParams* _val_ptr
21682168
cdef ccudart.cudaGraphNodeParams* _ptr
21692169
cdef cudaKernelNodeParamsV2 _kernel
21702170
cdef cudaMemcpyNodeParams _memcpy

cuda/cudart.pyx.in

Lines changed: 63 additions & 61 deletions
Large diffs are not rendered by default.

cuda/nvrtc.pyx.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# this software. Any use, reproduction, disclosure, or distribution of
66
# this software and related documentation outside the terms of the EULA
77
# is strictly prohibited.
8-
from typing import List, Tuple, Any
8+
from typing import List, Tuple, Any, Optional
99
from enum import IntEnum
1010
import cython
1111
import ctypes

cuda/tests/test_cuda.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,12 @@ def test_device_get_name():
610610
expect = p.stdout.split(delimiter)
611611
size = 64
612612
_, got = cuda.cuDeviceGetName(size, device)
613-
# Returned value is bytes, and we expect it to be of requested size
614-
# assert len(got) == size
615613
got = got.split(b'\x00')[0]
616-
assert got in expect
614+
if any(b'Unable to determine the device handle for' in result for result in expect):
615+
# Undeterministic devices get waived
616+
pass
617+
else:
618+
assert got in expect
617619

618620
err, = cuda.cuCtxDestroy(ctx)
619621
assert(err == cuda.CUresult.CUDA_SUCCESS)

examples/extra/jit_program_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def main():
9696
NUM_THREADS = 128
9797
NUM_BLOCKS = 32
9898

99-
a = np.array([2.0], dtype=np.float32)
99+
a = np.float32(2.0)
100100
n = np.array(NUM_THREADS * NUM_BLOCKS, dtype=np.uint32)
101101
bufferSize = n * a.itemsize
102102

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Cython==0.29.34
1+
Cython>=3.0.0
22
pytest>=6.2.4
33
pytest-benchmark>=3.4.1
44
numpy>=1.21.1

0 commit comments

Comments
 (0)