@@ -217,33 +217,50 @@ undefined behavior. The `win32_nt_handle` handle type is only supported on
217217Windows operating systems, while the `opaque_fd` handle type is only supported
218218on POSIX compliant operating systems.
219219
220+ Only two values of `externalMemHandleType` are supported by this extension:
221+
222+ - `external_mem_handle_type::opaque_fd` is supported when the host is a Posix
223+ compliant operating system.
224+
225+ - `external_mem_handle_type::win32_nt_handle`` is supported when the host is
226+ Windows.
227+
228+ No other values are supported. This function will throw a `sycl::exception` with
229+ the `errc::feature_not_supported` code if an unsupported value is passed.
230+
220231This function will throw a `sycl::exception` with `errc::feature_not_supported`
221232if the device `syclDevice` does not have
222233`aspect::ext_oneapi_exportable_device_mem`.
223234
224235This function will throw a `sycl::exception` with the `errc::runtime` code if
225236any error occurs while allocating the memory.
226237
227- This function will throw a `sycl::exception` with the code `errc::invalid` if
228- the `externalMemHandleType` passed is not supported by the backend
229- implementation.
230-
231238```c++
232239
233240namespace sycl::ext::oneapi::experimental {
234241
235242template <external_mem_handle_type ExternalMemHandleType>
236- exported_mem_t<ExternalMemHandleType>
243+ __return_type__
237244export_device_mem_handle(void *deviceMemory, const sycl::device &syclDevice,
238245 const sycl::context &syclContext);
239246
240247template <external_mem_handle_type ExternalMemHandleType>
241- exported_mem_t<ExternalMemHandleType>
248+ __return_type__
242249export_device_mem_handle(void *deviceMemory, const sycl::queue &syclQueue);
243250
244251}
245252```
246253
254+ Constraints: `ExternalMemHandleType` is either
255+ `external_mem_handle_type::opaque_fd` or
256+ `external_mem_handle_type::win32_nt_handle`.
257+
258+ When `ExternalMemHandleType` is `external_mem_handle_type::opaque_fd`, the
259+ `__return_type__` is `int`.
260+
261+ When `ExternalMemHandleType` is `external_mem_handle_type::win32_nt_handle`, the
262+ `__return_type__` is `void *`.
263+
247264The `export_device_mem_handle` function accepts a `void *` representing a device
248265allocation made using `alloc_exportable_device_mem`.
249266
@@ -255,9 +272,6 @@ The value of `ExternalMemHandleType` must match the value passed to
255272`ExternalMemHandleType` value that not match the value passed to
256273`alloc_exportable_device_mem` results in undefined behavior.
257274
258- The implementation of this function does not have to be defined for every value
259- of the `external_mem_handle_type` enum.
260-
261275The `syclDevice` and `syclContext` passed to `export_device_mem_handle` must
262276match the device and context used when the `deviceMemory` was allocated using
263277`alloc_exportable_device_mem`. If a `syclQueue` is passed, it must also be
@@ -365,10 +379,6 @@ experimental extension intended to gather early feedback, we have not
365379implemented this functionality yet. However, we are aware of this limitation
366380and plan to address it in future versions of this extension.
367381
368- As noted above in the document, the {dpcpp} implementation currently
369- supports exporting memory with the `opaque_fd` and `win32_nt_handle` handle
370- types, and only on the Level Zero backend.
371-
372382== Revision History
373383
374384[frame="none",options="header"]
0 commit comments