Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Python Numba Cuda Accelerated Array Sorting

I am looking to build a python function to do some kind of on a array using gpu because the multi-dimensional array is around 1-2 million in size

here is my code:

import numpy as np
x = [[1,2,3],[12,32,34],[4,32,77]]
y = [[1,2,3],[12,32,34],[4,32,77]]

@vectorize([void(f4[:], f4[:])], target='cuda')
def g(x, y):
    x[0] = 4
    y[1] = 3
    # more code array stuff here ...


x = np.array(x, dtype='f4')
y = np.array(y, dtype='f4')
print(g(x, y))

but the code is not working and i can see lot of errors, please help

Error:

Exception has occurred: TypeError Buffer dtype cannot be buffer File

"E:\Python\GPU\cuda-gpu.py", line 7, in

@vectorize([int64(int64[:])], target='cuda')

Comments