Skip to content

Commit 10dea37

Browse files
committed
Apply suggestions
1 parent 6122437 commit 10dea37

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_memory_export.asciidoc

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,33 +217,50 @@ undefined behavior. The `win32_nt_handle` handle type is only supported on
217217
Windows operating systems, while the `opaque_fd` handle type is only supported
218218
on 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+
220231
This function will throw a `sycl::exception` with `errc::feature_not_supported`
221232
if the device `syclDevice` does not have
222233
`aspect::ext_oneapi_exportable_device_mem`.
223234

224235
This function will throw a `sycl::exception` with the `errc::runtime` code if
225236
any 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

233240
namespace sycl::ext::oneapi::experimental {
234241

235242
template <external_mem_handle_type ExternalMemHandleType>
236-
exported_mem_t<ExternalMemHandleType>
243+
__return_type__
237244
export_device_mem_handle(void *deviceMemory, const sycl::device &syclDevice,
238245
const sycl::context &syclContext);
239246

240247
template <external_mem_handle_type ExternalMemHandleType>
241-
exported_mem_t<ExternalMemHandleType>
248+
__return_type__
242249
export_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+
247264
The `export_device_mem_handle` function accepts a `void *` representing a device
248265
allocation 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-
261275
The `syclDevice` and `syclContext` passed to `export_device_mem_handle` must
262276
match 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
365379
implemented this functionality yet. However, we are aware of this limitation
366380
and 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

Comments
 (0)