OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pyarrow.cuda and numba.cuda interoperability


hi Pearu,

You can construct a host buffer using pyarrow.foreign_buffer

http://arrow.apache.org/docs/python/generated/pyarrow.foreign_buffer.html#pyarrow.foreign_buffer

It would be great to have analogous functionality for CUDA. Last
summer I created this JIRA about "attaching" to a CUDA context created
by another library, may be related:

https://issues.apache.org/jira/browse/ARROW-1423

- Wes
On Wed, Oct 3, 2018 at 12:49 PM Pearu Peterson
<pearu.peterson@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> pa.cuda.CudaBuffer provides address and size of a device memory, so one can
> construct numba.cuda MemoryPointer from a CudaBuffer instance and hence
> there exists a way to pass CudaBuffer instances to numba.cuda jitted
> functions.
>
> The other way, having a device pointer and size (say, from numba.cuda
> objects) and then construct a CudaBuffer from it, is not currently possible
> within pyarrow.
>
> Since C++ CudaBuffer has the corresponding constructor already that takes
> the address and size (and context) to produce CudaBuffer instance, would it
> make sense to support this also in Python level? [I can give the
> implementation a try if so]
>
> Is it possible to construct a pyarrow.Buffer instance from a host pointer
> value and size?
>
> Best regards,
> Pearu