Skip to content

Commit 58c403e

Browse files
committed
error consistency for aquiring and releasing external mem objects
1 parent 47a785f commit 58c403e

1 file changed

Lines changed: 48 additions & 46 deletions

File tree

api/opencl_runtime_layer.asciidoc

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6077,31 +6077,32 @@ its completion event.
60776077
is executed successfully.
60786078
Otherwise, it returns one of the following errors:
60796079

6080-
* {CL_INVALID_VALUE} if _num_mem_objects_ is zero and _mem_objects_ is not
6081-
a `NULL` value, or if _num_mem_objects_ is greater than 0 and
6082-
_mem_objects_ is `NULL`.
6083-
* {CL_INVALID_MEM_OBJECT} if any of the memory objects in _mem_objects_ is
6084-
not a valid OpenCL memory object created using an external memory
6085-
handle.
60866080
* {CL_INVALID_COMMAND_QUEUE}
6087-
** if _command_queue_ is not a valid command-queue, or
6088-
** if device associated with _command_queue_ is not one of the devices
6089-
specified by {CL_MEM_DEVICE_HANDLE_LIST_KHR} at the time of creating
6090-
one or more of _mem_objects_, or
6091-
** if one or more of _mem_objects_ belong to a context that does not
6092-
contain a device associated with _command_queue_.
6081+
** if _command_queue_ is not a valid command-queue
6082+
** if the device associated with _command_queue_ is not one of the devices
6083+
specified by {CL_MEM_DEVICE_HANDLE_LIST_KHR} at the time of creating
6084+
one or more of _mem_objects_
6085+
** if one or more of _mem_objects_ belong to a context that does not
6086+
contain a device associated with _command_queue_
6087+
* {CL_INVALID_VALUE}
6088+
** if _num_mem_objects_ is zero and _mem_objects_ is not `NULL`
6089+
** if _num_mem_objects_ is greater than zero and _mem_objects_ is `NULL`
6090+
* {CL_INVALID_MEM_OBJECT}
6091+
** if any of the memory objects in _mem_objects_ is not a valid OpenCL memory object created using an external memory handle
60936092
* {CL_INVALID_EVENT_WAIT_LIST}
6094-
** if _event_wait_list_ is `NULL` and _num_events_in_wait_list_ is not 0,
6095-
or
6096-
** if _event_wait_list_ is not `NULL` and _num_events_in_wait_list_ is 0,
6097-
or
6098-
** if event objects in _event_wait_list_ are not valid events.
6099-
* {CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST} if the execution status
6100-
of any of the events in _event_wait_list_ is a negative integer value.
6101-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources
6102-
required by the OpenCL implementation on the device.
6103-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
6104-
required by the OpenCL implementation on the host.
6093+
** if _event_wait_list_ is `NULL` and _num_events_in_wait_list_ greater than zero
6094+
** if _event_wait_list_ is not `NULL` and _num_events_in_wait_list_ is zero
6095+
** if event objects in _event_wait_list_ are not valid events
6096+
// TODO: Do we want this to be an error? For other APIs, it is only an error when the API is blocking.
6097+
* {CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST}
6098+
** if the execution status of any of the events in _event_wait_list_ is a negative integer value indicating an error.
6099+
This error code is <<unified-spec, missing before>> version 1.1.
6100+
* {CL_OUT_OF_RESOURCES}
6101+
** if there is a failure to allocate resources required by the OpenCL
6102+
implementation on the device
6103+
* {CL_OUT_OF_HOST_MEMORY}
6104+
** if there is a failure to allocate resources required by the OpenCL
6105+
implementation on the host
61056106
--
61066107

61076108
[open,refpage='clEnqueueReleaseExternalMemObjectsKHR',desc='Enqueue a command to release OpenCL memory objects created from external memory handles',type='protos']
@@ -6174,31 +6175,32 @@ its completion event.
61746175
is executed successfully.
61756176
Otherwise, it returns one of the following errors:
61766177

6177-
* {CL_INVALID_VALUE} if _num_mem_objects_ is zero and _mem_objects_ is not
6178-
a `NULL` value, or if _num_mem_objects_ is greater than 0 and
6179-
_mem_objects_ is `NULL`.
6180-
* {CL_INVALID_MEM_OBJECT} if any of the memory objects in _mem_objects_ is
6181-
not a valid OpenCL memory object created using an external memory
6182-
handle.
61836178
* {CL_INVALID_COMMAND_QUEUE}
6184-
** if _command_queue_ is not a valid command-queue, or
6185-
** if device associated with _command_queue_ is not one of the devices
6186-
specified by {CL_MEM_DEVICE_HANDLE_LIST_KHR} at the time of creating
6187-
one or more of _mem_objects_, or
6188-
** if one or more of _mem_objects_ belong to a context that does not
6189-
contain a device associated with _command_queue_.
6179+
** if _command_queue_ is not a valid command-queue
6180+
** if device associated with _command_queue_ is not one of the devices
6181+
specified by {CL_MEM_DEVICE_HANDLE_LIST_KHR} at the time of creating
6182+
one or more of _mem_objects_
6183+
** if one or more of _mem_objects_ belong to a context that does not
6184+
contain a device associated with _command_queue_
6185+
* {CL_INVALID_VALUE}
6186+
** if _num_mem_objects_ is zero and _mem_objects_ is not `NULL`
6187+
** if _num_mem_objects_ is greater than zero and _mem_objects_ is `NULL`
6188+
* {CL_INVALID_MEM_OBJECT}
6189+
** if any of the memory objects in _mem_objects_ is not a valid OpenCL memory object created using an external memory handle
61906190
* {CL_INVALID_EVENT_WAIT_LIST}
6191-
** if _event_wait_list_ is `NULL` and _num_events_in_wait_list_ is not 0,
6192-
or
6193-
** if _event_wait_list_ is not `NULL` and _num_events_in_wait_list_ is 0,
6194-
or
6195-
** if event objects in _event_wait_list_ are not valid events.
6196-
* {CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST} if the execution status
6197-
of any of the events in _event_wait_list_ is a negative integer value.
6198-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources
6199-
required by the OpenCL implementation on the device.
6200-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
6201-
required by the OpenCL implementation on the host.
6191+
** if _event_wait_list_ is `NULL` and _num_events_in_wait_list_ greater than zero
6192+
** if _event_wait_list_ is not `NULL` and _num_events_in_wait_list_ is zero
6193+
** if event objects in _event_wait_list_ are not valid events
6194+
// TODO: Do we want this to be an error? For other APIs, it is only an error when the API is blocking.
6195+
* {CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST}
6196+
** if the execution status of any of the events in _event_wait_list_ is a negative integer value indicating an error.
6197+
This error code is <<unified-spec, missing before>> version 1.1.
6198+
* {CL_OUT_OF_RESOURCES}
6199+
** if there is a failure to allocate resources required by the OpenCL
6200+
implementation on the device
6201+
* {CL_OUT_OF_HOST_MEMORY}
6202+
** if there is a failure to allocate resources required by the OpenCL
6203+
implementation on the host
62026204
--
62036205

62046206

0 commit comments

Comments
 (0)