|
| 1 | +# Examples of using `dpctl` |
| 2 | + |
| 3 | +The `dpctl` is a foundational package facilitating use of [SYCL](sycl) to extend Python's reach to heterogeneous systems. |
| 4 | + |
| 5 | +## Python |
| 6 | + |
| 7 | +The `dpctl` provides Python API to SYCL runtime permitting user to |
| 8 | +inspect the heterogeneous [platform], |
| 9 | +[select](device_seelection) amongst available devices, |
| 10 | +query [properties](device_descriptors) of created devices, |
| 11 | +and construct [queues] to specify execution placement of offloaded computation. |
| 12 | + |
| 13 | +Additionally, `dpctl.tensor` submodule allows to create ND-arrays on devices and manipulate them using `dpctl.tensor` library of array computation operations specified in [Python Array API standard](array_api). |
| 14 | + |
| 15 | +Examples of this functionality are located in the [python](python) folder. |
| 16 | + |
| 17 | +## Cython |
| 18 | + |
| 19 | +The `dpctl` integrates with [Cython], a native extension generator, to facilitate building |
| 20 | +SYCL-powered Python extensions. |
| 21 | + |
| 22 | +Examples of Python extensions written using Cython are located in the [cython](cython) folder. |
| 23 | + |
| 24 | +## Pybind11 |
| 25 | + |
| 26 | +Since [SYCL](sycl) is based on C++, [pybind11] is a natural tool of choice to author SYCL-powered |
| 27 | +Python extensions. The `dpctl` provides `dpctl4pybind11.hpp` integration header to provide natural |
| 28 | +mapping between SYCL C++ classes and `dpctl` Python types. |
| 29 | + |
| 30 | +Examples of Python extensions created with `pybind11` are located in the [pybind11](pybind11) folder. |
| 31 | + |
| 32 | +## C |
| 33 | + |
| 34 | +The `dpctl` implements `DPCTLSyclInterface` C library and C-API to work with Python objects and types |
| 35 | +implemented in `dpctl`. Use integration headers `dpctl_sycl_interface.h` and `dpctl_capi.h` to access |
| 36 | +this functionality. |
| 37 | + |
| 38 | +Examples of Python extensions created using C are located in [c](c) folder. |
| 39 | + |
| 40 | + |
| 41 | +[platform]: https://intelpython.github.io/dpctl/latest/docfiles/user_guides/manual/dpctl/platforms.html |
| 42 | +[device_selection]: https://intelpython.github.io/dpctl/latest/docfiles/user_guides/manual/dpctl/device_selection.html |
| 43 | +[device_descriptors]: https://intelpython.github.io/dpctl/latest/docfiles/user_guides/manual/dpctl/devices.html#device-aspects-and-information-descriptors |
| 44 | +[queues]: https://intelpython.github.io/dpctl/latest/docfiles/user_guides/manual/dpctl/queues.html |
| 45 | +[array_api]: https://data-apis.org/array-api/ |
| 46 | +[sycl]: https://registry.khronos.org/SYCL/ |
| 47 | +[Cython]: https://cython.org/ |
| 48 | +[pybind11]: https://pybind11.readthedocs.io |
0 commit comments