You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Collect all input kernel arguments into a single tuple for further processing
411
411
kernelValues = (
412
412
np.array(1, dtype=np.uint32),
413
-
np.array([pInt_host], dtype=np.uint64),
413
+
np.array([pInt_host], dtype=np.intp),
414
414
np.array(123.456, dtype=np.float32),
415
-
np.array([pFloat_host], dtype=np.uint64),
415
+
np.array([pFloat_host], dtype=np.intp),
416
416
np.array([5], testStruct),
417
-
np.array([pStruct_host], dtype=np.uint64),
417
+
np.array([pStruct_host], dtype=np.intp),
418
418
)
419
419
```
420
420
@@ -424,7 +424,7 @@ with a [ctypes](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.c
424
424
By having the final array object contain all pointers, we fulfill the contiguous array requirement:
425
425
426
426
```python
427
-
kernelParams = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.uint64)
427
+
kernelParams = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp)
428
428
```
429
429
430
430
The launch API supports [Buffer Protocol](https://docs.python.org/3/c-api/buffer.html) objects, therefore we can pass the array object directly.
@@ -546,15 +546,15 @@ def main():
546
546
...
547
547
```
548
548
549
-
For NumPy, we can convert these CUDA types by leveraging the `__int__()` call to fetch the address of the underlying `cudaTextureObject_t` C object and wrapping it in a NumPy object array of type `np.uint64`:
549
+
For NumPy, we can convert these CUDA types by leveraging the `__int__()` call to fetch the address of the underlying `cudaTextureObject_t` C object and wrapping it in a NumPy object array of type `np.intp`:
550
550
551
551
```python
552
552
kernelValues = (
553
-
np.array([d_data], dtype=np.uint64),
553
+
np.array([d_data], dtype=np.intp),
554
554
np.array(width, dtype=np.uint32),
555
-
np.array([int(tex)], dtype=np.uint64),
555
+
np.array([int(tex)], dtype=np.intp),
556
556
)
557
-
kernelArgs = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.uint64)
557
+
kernelArgs = np.array([arg.ctypes.data for arg in kernelValues], dtype=np.intp)
558
558
```
559
559
560
560
For ctypes, we leverage the special handling of `None` type since each Python class already implements `getPtr()`:
0 commit comments