Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/pyarrow/_cuda.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ cdef class Context(_Weakrefable):
import numba.cuda
context = numba.cuda.current_context()
return Context(device_number=context.device.id,
handle=context.handle.value)
handle=int(context.handle))

def to_numba(self):
"""
Expand Down
6 changes: 3 additions & 3 deletions python/pyarrow/tests/test_cuda_numba_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def teardown_module(module):
ids=context_choice_ids)
def test_context(c):
ctx, nb_ctx = context_choices[c]
assert ctx.handle == nb_ctx.handle.value
assert ctx.handle == ctx.to_numba().handle.value
assert ctx.handle == int(nb_ctx.handle)
assert ctx.handle == int(ctx.to_numba().handle)
ctx2 = cuda.Context.from_numba(nb_ctx)
assert ctx.handle == ctx2.handle
size = 10
Expand Down Expand Up @@ -203,7 +203,7 @@ def test_numba_context(c, dtype):
with nb_cuda.gpus[0]:
arr, cbuf = make_random_buffer(size, target='device',
dtype=dtype, ctx=ctx)
assert cbuf.context.handle == nb_ctx.handle.value
assert cbuf.context.handle == int(nb_ctx.handle)
mem = cbuf.to_numba()
darr = DeviceNDArray(arr.shape, arr.strides, arr.dtype, gpu_data=mem)
np.testing.assert_equal(darr.copy_to_host(), arr)
Expand Down
Loading