Skip to content

Commit

Permalink
Support Cython 3
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhurba01 committed Jan 8, 2024
1 parent 2ae98f9 commit e3a8ff9
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 154 deletions.
180 changes: 94 additions & 86 deletions cuda/cuda.pyx.in

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cuda/cudart.pxd.in
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ cdef class cudaGraphNodeParams:
Get memory address of class instance

"""
cdef ccudart.cudaGraphNodeParams __val
cdef ccudart.cudaGraphNodeParams* _val_ptr
cdef ccudart.cudaGraphNodeParams* _ptr
cdef cudaKernelNodeParamsV2 _kernel
cdef cudaMemcpyNodeParams _memcpy
Expand Down
124 changes: 63 additions & 61 deletions cuda/cudart.pyx.in

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cuda/nvrtc.pyx.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
from typing import List, Tuple, Any
from typing import List, Tuple, Any, Optional
from enum import IntEnum
import cython
import ctypes
Expand Down
8 changes: 5 additions & 3 deletions cuda/tests/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,12 @@ def test_device_get_name():
expect = p.stdout.split(delimiter)
size = 64
_, got = cuda.cuDeviceGetName(size, device)
# Returned value is bytes, and we expect it to be of requested size
# assert len(got) == size
got = got.split(b'\x00')[0]
assert got in expect
if any(b'Unable to determine the device handle for' in result for result in expect):
# Undeterministic devices get waived
pass
else:
assert got in expect

err, = cuda.cuCtxDestroy(ctx)
assert(err == cuda.CUresult.CUDA_SUCCESS)
Expand Down
2 changes: 1 addition & 1 deletion examples/extra/jit_program_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def main():
NUM_THREADS = 128
NUM_BLOCKS = 32

a = np.array([2.0], dtype=np.float32)
a = np.float32(2.0)
n = np.array(NUM_THREADS * NUM_BLOCKS, dtype=np.uint32)
bufferSize = n * a.itemsize

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cython==0.29.34
Cython>=3.0.0
pytest>=6.2.4
pytest-benchmark>=3.4.1
numpy>=1.21.1
Expand Down

0 comments on commit e3a8ff9

Please sign in to comment.