Skip to content

Instantly share code, notes, and snippets.

Created Jan 30, 2020
What would you like to do?
Numba CUDA jitclass question
import numba
import numba.cuda
import numpy as np
("x", numba.types.int32)
class XYZ:
def __init__(self, x):
self.x = x
def set_x(a: np.ndarray, xyz: XYZ) -> np.ndarray:
x = numba.cuda.grid(1)
if x >= a.shape[0]:
a[x] = xyz.x
a = np.zeros(5)
xyz = XYZ(10)
set_x(a, xyz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment