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
{{ message }}
Repository navigation
How to convert CUDA-Python to SYCL using dpctl? #1635
Would you kindly provide guidance on transitioning CUDA-Python code to SYCL? Specifically, I am interested in converting the code available here to SYCL utilizing dpctl. And also, is there any tool available for auto-migration of CUDA-Python sample to SYCL? (like SYCLOMATIC tool)
Additionally, could you please furnish any documentation detailing the mapping process, if available?
It leverages dpctl.program.create_program_from_source functions to compile OCL source, and submits kernel extracted from the program it using dpctl.SyclQueue.submit method.
There is no automated tool like available to aid in transition from CUDA-Python to SYCL. However, Syclomatic could be used to convert CUDA program to SYCL, and Python extension can be created leveraging dpctl to invoke SYCL functions in the translated code from Python.
Activity
oleksandr-pavlyk commentedon Apr 4, 2024
An example of dispatching kernels written in OpenCL language can be found in the dpctl's test suite: https://github.com/IntelPython/dpctl/blob/master/dpctl/tests/test_sycl_kernel_submit.py#L44-L94
It leverages
dpctl.program.create_program_from_sourcefunctions to compile OCL source, and submits kernel extracted from the program it usingdpctl.SyclQueue.submitmethod.That said, numba_dpex enables writing kernels in Python, not unlike
numba.cuda. Please refer to https://intelpython.github.io/numba-dpex/latest/user_guide/kernel_programming/index.html for examples.DPCTL comes with DPCTLSyclInterface library, which provides C-API to DPC++ runtime classes. Please refer https://github.com/IntelPython/dpctl/blob/master/libsyclinterface/tests/test_sycl_queue_submit.cpp for examples of kernel submission from C.
There is no automated tool like available to aid in transition from CUDA-Python to SYCL. However, Syclomatic could be used to convert CUDA program to SYCL, and Python extension can be created leveraging
dpctlto invoke SYCL functions in the translated code from Python.Examples of writing Python extensions using C++ that leverage SYCL can be found in https://github.com/IntelPython/dpctl/tree/master/examples/pybind11, but also in https://github.com/IntelPython/sample-data-parallel-extensions/
Please refer to https://dl.acm.org/doi/abs/10.1145/3529538.3529990 for more details.