Closed
Description
The basic goals are:
- Add support for all SYCL types that can be passed as kernel arguments (skip buffers/accessors for now):
- Design dpctl classes corresponding to SYCL kernel argument types dpctl#71 NumPy dtype and cython types to dpctl dtype
- Design support for reduced precision types in dpctl dpctl#72 reduced/half precision types (i.e. BF16)
- Add support for complex numbers as kernel arguments dpctl#85 Add support for complex numbers.
- Add support for SYCL's vector types #1288
- Array as type (w/o extraction)
- Reduce the multiple places where we have checks to identify the kernel argument type:
- _unpack_argument(): Numba to ctypes: for DPPYKernel
https://github.com/IntelPython/numba-dppy/blob/2d100c5524e62b1fbd56ca9a96b173a75cf45bec/numba_dppy/compiler.py#L456 - _populate_args(): ctypes to void** and DPCTLKernelArgType*: for submit
https://github.com/IntelPython/dpctl/blob/609c8fd719ed61670127ad7c4e1dcbe783538ad6/dpctl/_sycl_queue.pyx#L116 - set_kernel_arg(): void** and DPCTLKernelArgType* to set_arg(): for SYCL
https://github.com/IntelPython/dpctl/blob/0763b213e1c1b5508f36964be5083a1ebea7ccaf/dpctl-capi/source/dpctl_sycl_queue_interface.cpp#L52 - resolve_and_return_dpctl_type(): Numba type to DPCTLKernelArgType: for prange offload
https://github.com/IntelPython/numba-dppy/blob/3e05b689f0eb7c67cb8d9b3fd0ec8bcfad316969/numba_dppy/dppy_host_fn_call_gen.py#L161
Tasks:
- Evaluate SYCL/DPC++ types (Sec 4.16 of SYCL 2020 Provisional Specification)
- Evaluate the implementation of Ctypes types library
- Evaluate the implementation for CUDA
- Evaluate Numba - ctypes connection
- Provide a wrapper for SYCL/DPC++ types (Sec 4.16 of SYCL 2020 Provisional Specification) similar to what Ctypes does for C types
Design requirements:
- Create a typing library inside dpctl similar to
сtypes._SimpleCData
or even deriving from it to have wrappers for all SYCL types including reduced precision. - Add new types to Numba as needed (e.g. for reduced precision types and short vector).
- Have Numba-dppy specific type inference so that we can infer types as dpctl types.
- Pass dpctl types to backend C API and do the type casting only once there.
Links:
Problems:
- How to support vector types? How to define vector types in Python? Vector - fixed size array.
- DPC++ LLVM IR - For kernel getting vector. Is it possible to generate the same IR for vectors?