We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi~ I found the function of len() is invalid to dynamic share array. Here is my code snippet:
@cuda.jit def kern_fun() dynamic_share_array = cuda.shared.array(0, numba.float32) fill_value(dynamic_share_array) print(len(dynamic_share_array)) main(): kern_fun[1, 10, 0, 100]()
the output of print is '0'. Any ideas?
The text was updated successfully, but these errors were encountered:
Also, I found the negative index of dynamic share array is invalid.
Sorry, something went wrong.
This may be fixed by #5099 - in any case, it won't work without it.
This is now working, probably because of #5099
@cuda.jit def kern_fun(): dsa = cuda.shared.array(0, numba.float32) print(len(dsa)) kern_fun[1, 1, 0, 100]()
prints:
25
Negative indices also seem to be working (from a quick check):
@cuda.jit def fill_last(x): dsa = cuda.shared.array(0, numba.float64) dsa[-1] = 99 i = cuda.grid(1) x[i] = dsa[i] x = np.zeros(10) fill_last[1, 10, 0, 80](x) print(x)
array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 99.])
I'll suggest leaving this issue open as I'd like to make a PR for a few test cases to check that length and negative indexing is robust.
No branches or pull requests
Hi~
I found the function of len() is invalid to dynamic share array. Here is my code snippet:
the output of print is '0'. Any ideas?
The text was updated successfully, but these errors were encountered: