You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need this so that Sycl headers do not have to be directly included in the Cython extension module and we can use MSVC/GCC to build the extension and link to our helper (libDPPLSyclInteface).
Cython extension:
We need three classes: MemoryUSMShared, MemoryUSMHost, MemoryUSMDevice. Each class corresponds to the three USM memory allocator.
MemoryUSMDevice should not expose __getbuffer__ as Python objects cannot directly use device memory.
The __cinit__ of the Memory classes perhaps should provide a way to specify the context in which memory is to be allocated. The other option will be to use dppl.get_current_queue(). Using the current queue always can lead to programmer errors where he/she tries to use a memory allocated on a given context on a device that is not in that context.
MemoryUSMxxx should provide a factory function to copy data between incompatible device.
@PokhodenkoSA Look at #30. It introduces changes in how a Sycl queue is stored in dppl. I have added a new class SyclQueue that replaces the previous Py_Capsule. The changes were suggested by @oleksandr-pavlyk to make it easier for us to get the sycl::context from the queue. You can now use SyclQueue::get_sycl_context().get_context_ptr() to get an opaque reference to the context pointer of the queue.
Please use the new SyclQueue class in your memory module. We most probably need a sycl_core.pxd to provide you with the Cython header exposing SyclQueue and SyclContext. I will absolutely not mind if you create that pxd file before I get to it 😉.
Activity
diptorupd commentedon Sep 15, 2020
@PokhodenkoSA Look at #30. It introduces changes in how a Sycl queue is stored in dppl. I have added a new class SyclQueue that replaces the previous Py_Capsule. The changes were suggested by @oleksandr-pavlyk to make it easier for us to get the sycl::context from the queue. You can now use SyclQueue::get_sycl_context().get_context_ptr() to get an opaque reference to the context pointer of the queue.
Please use the new SyclQueue class in your memory module. We most probably need a
sycl_core.pxdto provide you with the Cython header exposing SyclQueue and SyclContext. I will absolutely not mind if you create that pxd file before I get to it 😉.diptorupd commentedon Sep 18, 2020
Can we expose the USM fine-grained control functions
mem_adviseandprefetchin the C API? We might want to use them in Numba.PokhodenkoSA commentedon Sep 18, 2020
This methods will belong to
SyclQueueand will getMemoryUSMclasses. Is it correct?