我知道如何使用np.array
或np.zeros
或np.empty(shape, dtype)
然后使用cuda.to_device
复制在主机内创建全局设备功能。
此外,可以将共享数组声明为cuda.shared.array(shape, dtype)
但是如何在 gpu 函数内的特定线程的寄存器中创建一个恒定大小的数组。
我试过了cuda.device_array
,np.array
但没有任何效果。
我只是想在一个线程中执行此操作-
x = array(CONSTANT, int32) # should make x for each thread