-
Notifications
You must be signed in to change notification settings - Fork 29
Implementing USM memory management in dpCtrl #27
New issue
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
Comments
@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 |
Can we expose the USM fine-grained control functions |
This methods will belong to |
PyDPPL should expose sycl USM allocators to Python.
What needs to be done?
Add a C-API wrapper into
pydppl/backends
for the functions that we need fromcl::sycl::usm
. The C-API will be similar to what we currently have forcl::sycl::queue
(ref. https://github.com/IntelPython/pydppl/blob/master/backends/include/dppl_sycl_queue_interface.h).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:
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.__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 usedppl.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.The text was updated successfully, but these errors were encountered: