I have optimized some python code using the decorator @jit from numba library. However, I want to indicate to @jit to use my GPU device explicitly. From: Difference between @cuda.jit and @jit(target='gpu'), I understand that I need to use @jit(target="cuda") to do it.
I tried to do it by doing something like this:
from numba import jit, cuda
@jit(target='cuda') # The code runs normally without (target='cuda')
def function(args):
# some code
And I got the following error:
KeyError: "Unrecognized options: {'target'}. Known options are dict_keys(['_nrt', 'boundscheck', 'debug', 'error_model', 'fastmath', 'forceinline', 'forceobj', 'inline', 'looplift', 'no_cfunc_wrapper', 'no_cpython_wrapper', 'no_rewrites', 'nogil', 'nopython', 'parallel', 'target_backend'])"
I have read this: How to run numba.jit decorated function on GPU? but the solution did not work.
I would appreciate some help to make @jit(target='cuda') work without rewriting the code using @cuda.jit as this last one is for writing CUDA kernel in Python and compile and run it.
Many thanks in advance!