@@ -111,8 +111,9 @@ handles to import SYCL allocated memory into external APIs.
111111exporting memory by the implementation. Currently, the {dpcpp} implementation
112112only supports exporting memory with the `opaque_fd` and `win32_nt_handle` handle
113113types. This enum is shared with the memory import functionality defined in the
114- Bindless Images extension, where more handle types may be supported for
115- importing memory into SYCL.
114+ https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_bindless_images.asciidoc[sycl_ext_oneapi_bindless_images]
115+ extension, where more handle types may be supported for importing memory into
116+ SYCL.
116117_{endnote}_]
117118
118119```c++
@@ -127,26 +128,26 @@ enum class external_mem_handle_type {
127128 win32_nt_dx11_resource = 4,
128129};
129130
130- template <export_mem_handle_type ExportMemHandleType >
131+ template <external_mem_handle_type ExternalMemHandleType >
131132struct exported_mem;
132133
133134template <>
134- struct exported_mem<export_mem_handle_type ::opaque_fd> {
135+ struct exported_mem<external_mem_handle_type ::opaque_fd> {
135136 using type = int;
136137};
137138
138139template <>
139- struct exported_mem<export_mem_handle_type ::win32_nt_handle> {
140+ struct exported_mem<external_mem_handle_type ::win32_nt_handle> {
140141 using type = void *;
141142};
142143
143- template <export_mem_handle_type ExportMemHandleType >
144- using exported_mem_t = typename exported_mem<ExportMemHandleType >::type;
144+ template <external_mem_handle_type ExternalMemHandleType >
145+ using exported_mem_t = typename exported_mem<ExternalMemHandleType >::type;
145146
146147}
147148```
148149
149- The `export_mem_handle_type ` enum class defines the types of external memory
150+ The `external_mem_handle_type ` enum class defines the types of external memory
150151resource handles that can be exported by this extension. The `opaque_fd` and
151152`win32_nt_handle` values are used during allocation of exportable memory to
152153indicate the type of handle that will later be returned by the
@@ -159,11 +160,11 @@ The `win32_nt_handle` handle type corresponds to a Windows NT handle, which is
159160represented by a `void *`.
160161
161162The `exported_mem` template struct is specialized for each of the
162- `export_mem_handle_type ` values. Each specialization defines a `type` alias that
163- represents the type of the exported memory handle for that specific handle.
163+ `external_mem_handle_type ` values. Each specialization defines a `type` alias
164+ that represents the type of the exported memory handle for that specific handle.
164165
165166The `exported_mem_t` type alias allows the user to easily obtain the type of
166- the exported memory handle based on the `export_mem_handle_type ` template
167+ the exported memory handle based on the `external_mem_handle_type ` template
167168parameter.
168169
169170=== API of the extension
@@ -174,13 +175,13 @@ namespace sycl::ext::oneapi::experimental {
174175
175176void *alloc_exportable_device_mem(
176177 size_t alignment, size_t size,
177- export_mem_handle_type exportMemHandleType ,
178+ external_mem_handle_type externalMemHandleType ,
178179 const sycl::device &syclDevice, const sycl::context &syclContext,
179180 const property_list& propList = {});
180181
181182void *alloc_exportable_device_mem(
182183 size_t alignment, size_t size,
183- export_mem_handle_type exportMemHandleType ,
184+ external_mem_handle_type externalMemHandleType ,
184185 const sycl::queue &syclQueue,
185186 const property_list& propList = {});
186187}
@@ -209,8 +210,8 @@ instance of `sycl::property_list`. Currently, this extension does not define
209210any properties that can be used with this function, so the `propList` parameter
210211is ignored and reserved for future use.
211212
212- The passed `exportMemHandleType ` must be supported by the operating system
213- running the SYCL application. Passing an `exportMemHandleType ` that is not
213+ The passed `externalMemHandleType ` must be supported by the operating system
214+ running the SYCL application. Passing an `externalMemHandleType ` that is not
214215supported by the operating system running the SYCL application results in
215216undefined behavior. The `win32_nt_handle` handle type is only supported on
216217Windows operating systems, while the `opaque_fd` handle type is only supported
@@ -223,23 +224,21 @@ if the device `syclDevice` does not have
223224This function will throw a `sycl::exception` with the `errc::runtime` code if
224225any error occurs while allocating the memory.
225226
226- [_Note:_ The {dpcpp} implementation of this function will throw a
227- `sycl::exception` with the code `errc::invalid` if the
228- `external_mem_handle_type` passed is not either `opaque_fd` or
229- `win32_nt_handle`.
230- _{endnote}_]
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.
231230
232231```c++
233232
234233namespace sycl::ext::oneapi::experimental {
235234
236- template <export_mem_handle_type ExportMemHandleType >
237- exported_mem_t<ExportMemHandleType >
235+ template <external_mem_handle_type ExternalMemHandleType >
236+ exported_mem_t<ExternalMemHandleType >
238237export_device_mem_handle(void *deviceMemory, const sycl::device &syclDevice,
239238 const sycl::context &syclContext);
240239
241- template <export_mem_handle_type ExportMemHandleType >
242- exported_mem_t<ExportMemHandleType >
240+ template <external_mem_handle_type ExternalMemHandleType >
241+ exported_mem_t<ExternalMemHandleType >
243242export_device_mem_handle(void *deviceMemory, const sycl::queue &syclQueue);
244243
245244}
@@ -249,11 +248,11 @@ The `export_device_mem_handle` function accepts a `void *` representing a device
249248allocation made using `alloc_exportable_device_mem`.
250249
251250The return type is determined by the template parameter,
252- `ExportMemHandleType `.
251+ `ExternalMemHandleType `.
253252
254- The value of `ExportMemHandleType ` must match the value passed to
253+ The value of `ExternalMemHandleType ` must match the value passed to
255254`alloc_exportable_device_mem` when the memory was allocated. Passing an
256- `ExportMemHandleType ` value that not match the value passed to
255+ `ExternalMemHandleType ` value that not match the value passed to
257256`alloc_exportable_device_mem` results in undefined behavior.
258257
259258The `syclDevice` and `syclContext` passed to `export_device_mem_handle` must
@@ -265,12 +264,6 @@ allocated.
265264This function will throw a `sycl::exception` with the `errc::runtime` code if
266265any error occurs while exporting the memory handle.
267266
268- [_Note:_ The {dpcpp} implementation of this function will throw a
269- `sycl::exception` with the code `errc::invalid` if the
270- `external_mem_handle_type` passed is not either `opaque_fd` or
271- `win32_nt_handle`.
272- _{endnote}_]
273-
274267[_Note:_ The returned handle may be used to import the SYCL allocated memory
275268into an external API, such as Vulkan or DirectX.
276269_{endnote}_]
0 commit comments