Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added support for building `dpctl` with AdaptiveCpp as the SYCL implementation, selected with `--sycl-provider=AdaptiveCpp` in `scripts/build_locally.py` or `-DDPCTL_SYCL_PROVIDER=AdaptiveCpp` [gh-2384](https://github.com/IntelPython/dpctl/pull/2384)
* Added `dpctl.backend_type.openmp` for the AdaptiveCpp OpenMP host device [gh-2384](https://github.com/IntelPython/dpctl/pull/2384)
* Added `DPCTLService_GetSyclProvider` C-API function and `dpctl._diagnostics.sycl_provider`, which report the SYCL implementation `dpctl` was built with [gh-2384](https://github.com/IntelPython/dpctl/pull/2384)
* Added kernel bundles in `input`, `object` and `executable` states for the kernels compiled into the application: `dpctl.compiler.get_kernel_bundle`, `has_kernel_bundle`, `compile`, `link`, `build` and `join`, the `dpctl.compiler.SyclInputKernelBundle`, `SyclObjectKernelBundle`, `SyclKernelId` and `SyclDeviceImage` classes, `get_kernel_ids` and `is_compatible`, and new `dpctl.compiler.SyclKernelBundle` queries (`state`, `backend`, `sycl_context`, `get_devices`, `is_empty`, `get_kernel_ids`, `has_kernel`, `get_kernel`, `get_device_images`, `contains_specialization_constants`, `native_specialization_constant`), with the matching `DPCTLKernelBundle_*`, `DPCTLInputKernelBundle_*`, `DPCTLObjectKernelBundle_*` and `DPCTLKernelId_*` C-API functions and the `SyclInputKernelBundle_*`, `SyclObjectKernelBundle_*` and `SyclKernelId_*` Cython C-API functions [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)
* Added the `selector` argument of `dpctl.compiler.get_kernel_bundle`, a callable that chooses the device images to include, with the `DPCTLKernelBundle_CreateFromContextWithSelector`, `DPCTLInputKernelBundle_CreateFromContextWithSelector`, `DPCTLObjectKernelBundle_CreateFromContextWithSelector` and `DPCTLDeviceImage_HasKernel` C-API functions [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)
* Added `dpctl4pybind11.hpp` type casters for `sycl::kernel_bundle<sycl::bundle_state::input>`, `sycl::kernel_bundle<sycl::bundle_state::object>` and `sycl::kernel_id`, and the `examples/pybind11/use_kernel_bundle` example that sets a SYCL specialization constant on a kernel bundle obtained in Python [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)
* Added `dpctl.compiler.load_kernel_library` and the `DPCTLKernelId_LoadLibrary` C-API function, which load a shared library with SYCL device code, e.g. compiled for CUDA or HIP devices, and return the ids of its kernels for use with `dpctl.compiler.get_kernel_bundle` [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)
* Added `dpctl.compiler.SyclKernel.get_work_group_size`, `get_preferred_work_group_size_multiple`, `get_private_mem_size`, `get_max_num_sub_groups`, `get_max_sub_group_size`, `get_compile_num_sub_groups` and `get_compile_sub_group_size`, which take an optional device of the kernel bundle and raise `ValueError` for another device, and the `DPCTLKernel_Get*ForDevice` and `DPCTLKernel_GetDevices` C-API functions [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)
* Added the `DPCTLKernelBundle_CreateFromOCLSourceWithBuildLog` and `DPCTLKernelBundle_CreateFromSpirvWithBuildLog` C-API functions, which return the build log of a failed build [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)

### Changed
* Object lifetime during offload is now managed by a list of releases deferred until the events that gate them have completed, rather than by a `host_task`. `dpctl` keeps one thread for looking over the list and running the releases that have come due, started by the first release deferred and again in the child of a `fork`, which takes the GIL to do so and lets a release call into the interpreter and free USM allocations [gh-2359](https://github.com/IntelPython/dpctl/pull/2359)
Expand All @@ -25,10 +31,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `dpctl.utils.SequentialOrderManager[q].submitted_events` includes the queue's last event for in-order queues when `sycl_ext_oneapi_in_order_queue_events` is available, and `wait()` waits for all work on an in-order queue [gh-2299](https://github.com/IntelPython/dpctl/pull/2299)
* Pickled `dpctl.memory.MemoryUSMShared`, `MemoryUSMDevice`, and `MemoryUSMHost` objects keep their queue instead of being restored on the default device. Pickling memory whose queue can not be pickled raises `pickle.PicklingError` [gh-2406](https://github.com/IntelPython/dpctl/pull/2406)
* NumPy is no longer a build dependency of `dpctl`, only a run-time dependency [gh-2436](https://github.com/IntelPython/dpctl/pull/2436)
* The `dpctl.compiler.SyclKernelBundleCompilationError` raised by `dpctl.compiler.create_kernel_bundle_from_source` and `create_kernel_bundle_from_spirv` contains the build log when the program could not be built [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)

### Deprecated
* Deprecated `dpctl.SyclQueue._submit_keep_args_alive` in favor of `dpctl.SyclQueue.keep_args_alive`, which it now calls and which behaves identically [gh-2359](https://github.com/IntelPython/dpctl/pull/2359)
* Deprecated the order manager's `add_event_pair`, `host_task_events` and `num_host_task_events`, as `host_task` is no longer used for managing object lifetimes, in favor of `add_event`, `add_cleanup_event`, `cleanup_events` and `num_cleanup_events`; they do not yet emit a `DeprecationWarning` [gh-2359](https://github.com/IntelPython/dpctl/pull/2359)
* Deprecated the `dpctl.compiler.SyclKernel` properties `work_group_size`, `preferred_work_group_size_multiple`, `private_mem_size`, `max_num_sub_groups`, `max_sub_group_size`, `compile_num_sub_groups` and `compile_sub_group_size` in favor of the `get_*` methods of the same name; they emit a `DeprecationWarning` [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)

### Removed
* Removed the deprecated `dpctl.program` submodule, use `dpctl.compiler` instead [gh-2407](https://github.com/IntelPython/dpctl/pull/2407)
Expand All @@ -43,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `dpctl.SyclPlatform.get_devices` no longer prints Unified Runtime warnings for `device_type="custom"` on non-OpenCL platforms, where custom devices are not supported [gh-2306](https://github.com/IntelPython/dpctl/pull/2306)
* Fixed building with the open source DPC++ compiler and CMake 4.5 or newer, which identifies it as `DPClang` instead of `Clang` [gh-2433](https://github.com/IntelPython/dpctl/pull/2433)
* Building with the open source DPC++ toolchain no longer requires the toolchain to bundle the OpenCL ICD loader, which `dpctl` loads at run time [gh-2435](https://github.com/IntelPython/dpctl/pull/2435)
* `DPCTLKernel_Get*` device-specific queries return 0 instead of terminating the process when the SYCL runtime throws [gh-2440](https://github.com/IntelPython/dpctl/pull/2440)

### Maintenance
* Removed the `-fno-sycl-id-queries-fit-in-int` compile option, which none of the `dpctl` extensions need since `dpctl.tensor` moved to `dpnp` [gh-2413](https://github.com/IntelPython/dpctl/pull/2413)
Expand Down
22 changes: 22 additions & 0 deletions docs/doc_sources/api_reference/dpctl/compiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ It implements creation of interoperability
as well as creation of individual ``sycl::kernel``, suitable for submission for
execution via :py:meth:`dpctl.SyclQueue.submit`.

It also exposes the kernel bundles of the kernels compiled into the
application, in ``input``, ``object`` and ``executable`` states, along with
the SYCL functions that compile, link, build and join them.

.. py:module:: dpctl.compiler

.. currentmodule:: dpctl.compiler
Expand All @@ -25,12 +29,30 @@ execution via :py:meth:`dpctl.SyclQueue.submit`.
create_kernel_bundle_from_sycl_source
is_sycl_source_compilation_available

.. autosummary::
:toctree: generated
:nosignatures:

get_kernel_bundle
has_kernel_bundle
get_kernel_ids
load_kernel_library
is_compatible
compile
link
build
join

.. autosummary::
:toctree: generated
:nosignatures:

SyclKernelBundle
SyclInputKernelBundle
SyclObjectKernelBundle
SyclKernel
SyclKernelId
SyclDeviceImage
SpecializationConstant

.. autosummary::
Expand Down
66 changes: 66 additions & 0 deletions docs/doc_sources/api_reference/dpctl_capi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ Exported typedefs

.. c:struct:: PySyclKernelBundleType

.. c:struct:: PySyclInputKernelBundleObject

.. c:struct:: PySyclInputKernelBundleType

.. c:struct:: PySyclObjectKernelBundleObject

.. c:struct:: PySyclObjectKernelBundleType

.. c:struct:: PySyclKernelIdObject

.. c:struct:: PySyclKernelIdType

To check whether a particular Python object is an instance of :py:class:`dpctl.SyclQueue`:

.. code-block:: C
Expand Down Expand Up @@ -211,3 +223,57 @@ API for :c:struct:`PySyclKernelBundleObject`

Note that function does not change the ownership of the ``KBRef`` instance and
the caller remains responsible for freeing ``KBRef`` as appropriate.


API for :c:struct:`PySyclInputKernelBundleObject`
-------------------------------------------------

.. c:function:: DPCTLSyclInputKernelBundleRef SyclInputKernelBundle_GetKernelBundleRef(struct PySyclInputKernelBundleObject *kb)

:param kb: Input object
:returns: borrowed instance of :c:struct:`DPCTLSyclInputKernelBundleRef` corresponding
to ``sycl::kernel_bundle<sycl::bundle_state::input>``

.. c:function:: struct PySyclInputKernelBundleObject * SyclInputKernelBundle_Make(DPCTLSyclInputKernelBundleRef KBRef)

:param KBRef: instance of :c:struct:`DPCTLSyclInputKernelBundleRef`
:returns: new Python object of type :c:struct:`PySyclInputKernelBundleType`

Note that function does not change the ownership of the ``KBRef`` instance and
the caller remains responsible for freeing ``KBRef`` as appropriate.


API for :c:struct:`PySyclObjectKernelBundleObject`
--------------------------------------------------

.. c:function:: DPCTLSyclObjectKernelBundleRef SyclObjectKernelBundle_GetKernelBundleRef(struct PySyclObjectKernelBundleObject *kb)

:param kb: Input object
:returns: borrowed instance of :c:struct:`DPCTLSyclObjectKernelBundleRef` corresponding
to ``sycl::kernel_bundle<sycl::bundle_state::object>``

.. c:function:: struct PySyclObjectKernelBundleObject * SyclObjectKernelBundle_Make(DPCTLSyclObjectKernelBundleRef KBRef)

:param KBRef: instance of :c:struct:`DPCTLSyclObjectKernelBundleRef`
:returns: new Python object of type :c:struct:`PySyclObjectKernelBundleType`

Note that function does not change the ownership of the ``KBRef`` instance and
the caller remains responsible for freeing ``KBRef`` as appropriate.


API for :c:struct:`PySyclKernelIdObject`
----------------------------------------

.. c:function:: DPCTLSyclKernelIdRef SyclKernelId_GetKernelIdRef(struct PySyclKernelIdObject *kid)

:param kid: Input object
:returns: borrowed instance of :c:struct:`DPCTLSyclKernelIdRef` corresponding
to ``sycl::kernel_id``

.. c:function:: struct PySyclKernelIdObject * SyclKernelId_Make(DPCTLSyclKernelIdRef KIdRef)

:param KIdRef: instance of :c:struct:`DPCTLSyclKernelIdRef`
:returns: new Python object of type :c:struct:`PySyclKernelIdType`

Note that function does not change the ownership of the ``KIdRef`` instance and
the caller remains responsible for freeing ``KIdRef`` as appropriate.
Loading
Loading