Merged
Conversation
…party cuda arrays
Codecov Report
@@ Coverage Diff @@
## master #2860 +/- ##
==========================================
- Coverage 85.84% 85.79% -0.06%
==========================================
Files 326 327 +1
Lines 68311 68422 +111
Branches 7721 7729 +8
==========================================
+ Hits 58643 58703 +60
- Misses 8428 8481 +53
+ Partials 1240 1238 -2 |
Contributor
|
I can confirm this works in combination with cupy/cupy#1144. import cupy
from numba import cuda
@cuda.jit
def add(x, y, out):
start = cuda.grid(1)
stride = cuda.gridsize(1)
for i in range(start, x.shape[0], stride):
out[i] = x[i] + y[i]
a = cupy.arange(10)
b = a * 2
out = cupy.empty_like(a)
print('out before:', out)
add[1, 32](a, b, out)
print('out after:', out)
print('array types:', type(a), type(b), type(out))Output: |
Contributor
|
It looks like support for |
Contributor
|
I think you forgot to check in |
Member
Author
|
Oops, added missing file now |
seibert
reviewed
May 17, 2018
|
|
||
| In addition to the device arrays, numba can consume any object that implements | ||
| :ref:`cuda array interface <cuda-array-interface>`. These objects can be | ||
| converted into a device array by creating a view of the GPU buffer using the |
Contributor
There was a problem hiding this comment.
I think we should phrase this as "These objects also can be manually converted into a Numba device array by creating a view of the GPU buffer using the following APIs:"
seibert
reviewed
May 17, 2018
| .. autofunction:: numba.cuda.to_device | ||
| :noindex: | ||
|
|
||
| In addition to the device arrays, numba can consume any object that implements |
Contributor
|
Two minor documentation nits, and then this looks good to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
for interop with 3rd party CUDA array.