From 563e8cf2e21e6a5493175efde535480e83bf43a9 Mon Sep 17 00:00:00 2001 From: Greg Lueck Date: Fri, 14 Nov 2025 08:14:08 -0500 Subject: [PATCH] [SYCL][Doc] Clarify work_group_scratch_memory errs Clarify the error conditions when launching a kernel that uses the sycl_ext_oneapi_work_group_scratch_memory extension. --- ...l_ext_oneapi_work_group_scratch_memory.asciidoc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_work_group_scratch_memory.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_work_group_scratch_memory.asciidoc index 757406b068fa4..d0fc02fe257fa 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_work_group_scratch_memory.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_work_group_scratch_memory.asciidoc @@ -141,16 +141,24 @@ device local memory required by the kernel in bytes. |=== -=== Total allocation check +=== Error conditions + +If a kernel's static call tree contains a call to +`get_work_group_scratch_memory`, then the `work_group_scratch_size` property +must be specified on every launch of the kernel. +Implementations are encouraged to throw a synchronous `exception` with the +`errc::memory_allocation` error code when this property is missing from the +kernel launch. If the total amount of device local memory requested exceeds a device's local memory capacity as reported by `info::device::local_mem_size` -then the implementation must throw a synchronous exception with the +then the implementation must throw a synchronous `exception` with the `errc::memory_allocation` error code from the kernel invocation command -(e.g. `parallel_for`). This check must take all APIs that allocation device +(e.g. `parallel_for`). This check must take all APIs that allocate device local memory into account, whether via the `work_group_scratch_size` property or other APIs such as `local_accessor`. + == Example [source,c++]