Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cuda_bindings/cuda/bindings/_lib/utils.pyx.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t
from libc.stddef cimport wchar_t
from libc.string cimport memcpy
from enum import Enum
from typing import List, Tuple
import ctypes
cimport cuda.bindings.cydriver as cydriver
import cuda.bindings.driver as driver
Expand Down Expand Up @@ -58,7 +57,7 @@ cdef class HelperKernelParams:
raise RuntimeError("Argument 'kernelParams' failed to retrieve buffer through Buffer Protocol")
self._pyobj_acquired = True
self._ckernelParams = <void**><void_ptr>self._pybuffer.buf
elif isinstance(kernelParams, (Tuple)) and len(kernelParams) == 2 and isinstance(kernelParams[0], (Tuple)) and isinstance(kernelParams[1], (Tuple)):
elif isinstance(kernelParams, (tuple)) and len(kernelParams) == 2 and isinstance(kernelParams[0], (tuple)) and isinstance(kernelParams[1], (tuple)):
# Hard run, construct and fill out contigues memory using provided kernel values and types based
if len(kernelParams[0]) != len(kernelParams[1]):
raise TypeError("Argument 'kernelParams' has tuples with different length")
Expand Down Expand Up @@ -117,7 +116,7 @@ cdef class HelperKernelParams:
raise TypeError("Unsupported type: " + str(type(ctype)))
idx += 1
else:
raise TypeError("Argument 'kernelParams' is not a valid type: Tuple[Tuple[Any, ...], Tuple[Any, ...]] or PyObject implimenting Buffer Protocol or Int")
raise TypeError("Argument 'kernelParams' is not a valid type: tuple[tuple[Any, ...], tuple[Any, ...]] or PyObject implimenting Buffer Protocol or Int")

def __dealloc__(self):
if self._pyobj_acquired is True:
Expand Down
Loading