Skip to content

Commit

Permalink
External memory import: Add assume linear query (KhronosGroup#861)
Browse files Browse the repository at this point in the history
Add query to clGetDeviceInfo for external memory handle types
that are assumed to be linear.
  • Loading branch information
joshqti authored and lakshmih committed Jun 13, 2023
1 parent ff88d06 commit 048dc1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/cl_khr_external_memory.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Accepted value for the _param_name_ parameter to {clGetDeviceInfo} to query exte
[source]
----
CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR 0x204F
CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_HANDLE_TYPES_KHR 0x????
----

New properties accepted as _properties_ to {clCreateBufferWithProperties} and {clCreateImageWithProperties}:
Expand Down Expand Up @@ -181,10 +182,15 @@ Following new enums are added to the list of supported _param_names_ by {clGetDe
| {CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR}
| {cl_external_memory_handle_type_khr_TYPE}[]
| Returns the list of importable external memory handle types supported by _device_.
| {CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_HANDLE_TYPES_KHR}
| {cl_external_memory_handle_type_khr_TYPE}[]
| Returns the list of importable external memory handle types supported by _device_, that are assumed to have linear layout when no other layout information is provided.
|====

{clGetDeviceInfo} when called with param_name {CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR} must return a non-empty list of external memory handle types for at least one of the devices in the platform.

{clGetDeviceInfo} when called with param_name {CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_HANDLE_TYPES_KHR} returns a list of external memory handle types that are assumed to have a linear memory layout. This list contains a subset of {CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR}. The returned list may be empty. External memory handle types not in {CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_HANDLE_TYPES_KHR} may have any memory layout.

Following new properties are added to the list of supported properties by {clCreateBufferWithProperties} and {clCreateImageWithProperties}.

[[external-memory-properties-table]]
Expand Down
4 changes: 4 additions & 0 deletions xml/cl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,7 @@ server's OpenCL/api-docs repository.
<enum value="0x204D" name="CL_DEVICE_SEMAPHORE_IMPORT_HANDLE_TYPES_KHR"/>
<enum value="0x204E" name="CL_DEVICE_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR"/>
<enum value="0x204F" name="CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR"/>
<enum value="0x????" name="CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_HANDLE_TYPES_KHR"/>
<enum value="0x2051" name="CL_DEVICE_HANDLE_LIST_KHR"/>
<unused start="0x2052" end="0x2054"/>
<enum value="0x2055" name="CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR"/>
Expand Down Expand Up @@ -6987,6 +6988,9 @@ server's OpenCL/api-docs repository.
<require comment="cl_device_info">
<enum name="CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR"/>
</require>
<require comment="cl_device_info">
<enum name="CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_HANDLE_TYPES_KHR"/>
</require>
<require comment="cl_mem_properties">
<enum name="CL_DEVICE_HANDLE_LIST_KHR"/>
<enum name="CL_DEVICE_HANDLE_LIST_END_KHR"/>
Expand Down

0 comments on commit 048dc1a

Please sign in to comment.