I'm trying to layer dask on top of my cuda functions, but when dask returns I get a NoneType object.
from numba import cuda
import numpy as np
from dask.distributed import Client, LocalCluster
@cuda.jit()
def addingNumbersCUDA (big_array, big_array2, save_array):
i = cuda.grid(1)
if i < big_array.shape[0]:
for j in range (big_array.shape[1]):
save_array[i][j] = big_array[i][j] * big_array2[i][j]
if __name__ == "__main__":
cluster = LocalCluster()
client = Client(cluster)
big_array = np.random.random_sample((100, 3000))
big_array2 = np.random.random_sample((100, 3000))
save_array = np.zeros(shape=(100, 3000))
arraysize = 100
threadsperblock = 64
blockspergrid = (arraysize + (threadsperblock - 1))
x = client.submit(addingNumbersCUDA[blockspergrid, threadsperblock], big_array, big_array2, save_array)
y = client.gather(x)
print(y)
I understand that you don't actually return in a cuda function and that the results are pushed back to the array you called in. Is this why I'm getting a noneType, or is it because I'm using dask wrong for cuda?