Skip to content

Commit d12c348

Browse files
authored
error code consistency for copies between buffers and images (KhronosGroup#1481)
1 parent 20ad2d9 commit d12c348

1 file changed

Lines changed: 94 additions & 90 deletions

File tree

api/opencl_runtime_layer.asciidoc

Lines changed: 94 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -4187,55 +4187,57 @@ argument value specified when _src_image_ or _dst_buffer_ is created is ignored
41874187
successfully.
41884188
Otherwise, it returns one of the following errors:
41894189

4190-
* {CL_INVALID_COMMAND_QUEUE} if _command_queue_ is not a valid host
4191-
command-queue.
4192-
* {CL_INVALID_CONTEXT} if the context associated with _command_queue_,
4193-
_src_image_ and _dst_buffer_ are not the same or if the context
4194-
associated with _command_queue_ and events in _event_wait_list_ are not
4195-
the same.
4196-
* {CL_INVALID_MEM_OBJECT} if _src_image_ is not a valid image object or
4197-
_dst_buffer_ is not a valid buffer object or if _src_image_ is a 1D
4198-
image buffer object created from _dst_buffer_.
4199-
* {CL_INVALID_VALUE} if _src_origin_ or _region_ is `NULL`.
4200-
* {CL_INVALID_VALUE} if the 1D, 2D or 3D rectangular region specified by
4201-
_src_origin_ and _src_origin_ + _region_ refers to a region outside
4202-
_src_image_, or if the region specified by _dst_offset_ and _dst_offset_
4203-
+ _dst_cb_ to a region outside _dst_buffer_.
4204-
* {CL_INVALID_VALUE} if values in _src_origin_ and _region_ do not follow
4205-
rules described in the argument description for _src_origin_ and
4206-
_region_.
4207-
* {CL_INVALID_EVENT_WAIT_LIST} if _event_wait_list_ is `NULL` and
4208-
_num_events_in_wait_list_ > 0, or _event_wait_list_ is not `NULL` and
4209-
_num_events_in_wait_list_ is 0, or if event objects in _event_wait_list_
4210-
are not valid events.
4211-
* {CL_MISALIGNED_SUB_BUFFER_OFFSET} if _dst_buffer_ is a sub-buffer object
4212-
and _offset_ specified when the sub-buffer object is created is not
4213-
aligned to {CL_DEVICE_MEM_BASE_ADDR_ALIGN} value for device associated
4214-
with _queue_.
4215-
This error code is <<unified-spec, missing before>> version 1.1.
4216-
* {CL_INVALID_IMAGE_SIZE} if image dimensions (image width, height,
4217-
specified or compute row and/or slice pitch) for _src_image_ are not
4218-
supported by device associated with _queue_.
4219-
* {CL_IMAGE_FORMAT_NOT_SUPPORTED} if image format (image channel order and
4220-
data type) for _src_image_ are not supported by device associated with
4221-
_queue_.
4222-
* {CL_MEM_OBJECT_ALLOCATION_FAILURE} if there is a failure to allocate
4223-
memory for data store associated with _src_image_ or _dst_buffer_.
4224-
* {CL_INVALID_OPERATION} if the device associated with _command_queue_ does
4225-
not support images (i.e. {CL_DEVICE_IMAGE_SUPPORT} specified in the
4226-
<<device-queries-table,Device Queries>> table is {CL_FALSE}).
4227-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
4228-
by the OpenCL implementation on the device.
4229-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
4230-
required by the OpenCL implementation on the host.
4190+
* {CL_INVALID_COMMAND_QUEUE}
4191+
** if _command_queue_ is not a valid host command-queue
4192+
* {CL_INVALID_CONTEXT}
4193+
** if the context associated with _command_queue_ and _src_image_ are not the same
4194+
** if the context associated with _command_queue_ and _dst_buffer_ are not the same
4195+
** if the context associated with _command_queue_ and events in _event_wait_list_ are not the same
4196+
* {CL_INVALID_MEM_OBJECT}
4197+
** if _src_image_ is not a valid image object
4198+
** if _dst_buffer_ is not a valid buffer object
4199+
** if _src_image_ is a 1D image buffer object created from _dst_buffer_
4200+
* {CL_INVALID_VALUE}
4201+
** if _src_origin_ is `NULL`
4202+
** if _region_ is `NULL`
4203+
** if the 1D, 2D or 3D rectangular region specified by _src_origin_ and _region_ is out of bounds of _src_image_
4204+
** if the region specified by _dst_offset_ and the computed _dst_cb_ is out of bounds of _dst_buffer_
4205+
** if values in _src_origin_ and _region_ do not follow the rules described in the argument description for _src_origin_ and _region_
42314206
ifdef::cl_khr_mipmap_image[]
4232-
* {CL_INVALID_MIP_LEVEL} if the {cl_khr_mipmap_image_EXT} extension is
4233-
supported, and the mip level specified in _src_origin_ is not a valid
4234-
level for _src_image_,
4207+
* {CL_INVALID_MIP_LEVEL}
4208+
** if the {cl_khr_mipmap_image_EXT} extension is supported and the mip level specified in _src_origin_ is not a valid level for _src_image_
42354209
endif::cl_khr_mipmap_image[]
4210+
* {CL_INVALID_EVENT_WAIT_LIST}
4211+
** if _event_wait_list_ is `NULL` and _num_events_in_wait_list_ is greater than zero
4212+
** if _event_wait_list_ is not `NULL` and _num_events_in_wait_list_ is zero
4213+
** if event objects in _event_wait_list_ are not valid events
4214+
* {CL_MISALIGNED_SUB_BUFFER_OFFSET}
4215+
** if _dst_buffer_ is a sub-buffer object and the offset specified when the
4216+
sub-buffer object was created is not aligned to the
4217+
{CL_DEVICE_MEM_BASE_ADDR_ALIGN} value for the device associated
4218+
with _command_queue_.
4219+
This error code is <<unified-spec, missing before>> version 1.1.
4220+
* {CL_INVALID_IMAGE_SIZE}
4221+
** if the dimensions for _src_image_, such as the image width or image height,
4222+
are not supported by the device associated with _command_queue_
4223+
* {CL_IMAGE_FORMAT_NOT_SUPPORTED}
4224+
** if the format for _src_image_, such as the image channel order or image
4225+
channel data type, are not supported by the device associated with
4226+
_command_queue_
4227+
* {CL_MEM_OBJECT_ALLOCATION_FAILURE}
4228+
** if there is a failure to allocate memory for the data store associated with _src_image_
4229+
** if there is a failure to allocate memory for the data store associated with _dst_buffer_
4230+
* {CL_INVALID_OPERATION}
4231+
** if the device associated with _command_queue_ does not support images (the query for {CL_DEVICE_IMAGE_SUPPORT} returns {CL_FALSE})
42364232
ifdef::cl_ext_immutable_memory_objects[]
4237-
* {CL_INVALID_OPERATION} if _dst_buffer_ was created with {CL_MEM_IMMUTABLE_EXT}.
4233+
** if _dst_buffer_ was created with {CL_MEM_IMMUTABLE_EXT}
42384234
endif::cl_ext_immutable_memory_objects[]
4235+
* {CL_OUT_OF_RESOURCES}
4236+
** if there is a failure to allocate resources required by the OpenCL
4237+
implementation on the device
4238+
* {CL_OUT_OF_HOST_MEMORY}
4239+
** if there is a failure to allocate resources required by the OpenCL
4240+
implementation on the host
42394241
--
42404242

42414243

@@ -4322,55 +4324,57 @@ argument value specified when _src_buffer_ or _dst_image_ is created is ignored
43224324
successfully.
43234325
Otherwise, it returns one of the following errors:
43244326

4325-
* {CL_INVALID_COMMAND_QUEUE} if _command_queue_ is not a valid host
4326-
command-queue.
4327-
* {CL_INVALID_CONTEXT} if the context associated with _command_queue_,
4328-
_src_buffer_ and _dst_image_ are not the same or if the context
4329-
associated with _command_queue_ and events in _event_wait_list_ are not
4330-
the same.
4331-
* {CL_INVALID_MEM_OBJECT} if _src_buffer_ is not a valid buffer object or
4332-
_dst_image_ is not a valid image object or if _dst_image_ is a 1D image
4333-
buffer object created from _src_buffer_.
4334-
* {CL_INVALID_VALUE} if _dst_origin_ or _region_ is `NULL`.
4335-
* {CL_INVALID_VALUE} if the 1D, 2D or 3D rectangular region specified by
4336-
_dst_origin_ and _dst_origin_ + _region_ refer to a region outside
4337-
_dst_image_, or if the region specified by _src_offset_ and _src_offset_
4338-
+ _src_cb_ refer to a region outside _src_buffer_.
4339-
* {CL_INVALID_VALUE} if values in _dst_origin_ and _region_ do not follow
4340-
rules described in the argument description for _dst_origin_ and
4341-
_region_.
4342-
* {CL_INVALID_EVENT_WAIT_LIST} if _event_wait_list_ is `NULL` and
4343-
_num_events_in_wait_list_ > 0, or _event_wait_list_ is not `NULL` and
4344-
_num_events_in_wait_list_ is 0, or if event objects in _event_wait_list_
4345-
are not valid events.
4346-
* {CL_MISALIGNED_SUB_BUFFER_OFFSET} if _src_buffer_ is a sub-buffer object
4347-
and _offset_ specified when the sub-buffer object is created is not
4348-
aligned to {CL_DEVICE_MEM_BASE_ADDR_ALIGN} value for device associated
4349-
with _queue_.
4350-
This error code is <<unified-spec, missing before>> version 1.1.
4351-
* {CL_INVALID_IMAGE_SIZE} if image dimensions (image width, height,
4352-
specified or compute row and/or slice pitch) for _dst_image_ are not
4353-
supported by device associated with _queue_.
4354-
* {CL_IMAGE_FORMAT_NOT_SUPPORTED} if image format (image channel order and
4355-
data type) for _dst_image_ are not supported by device associated with
4356-
_queue_.
4357-
* {CL_MEM_OBJECT_ALLOCATION_FAILURE} if there is a failure to allocate
4358-
memory for data store associated with _src_buffer_ or _dst_image_.
4359-
* {CL_INVALID_OPERATION} if the device associated with _command_queue_ does
4360-
not support images (i.e. {CL_DEVICE_IMAGE_SUPPORT} specified in the
4361-
<<device-queries-table,Device Queries>> table is {CL_FALSE}).
4362-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
4363-
by the OpenCL implementation on the device.
4364-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
4365-
required by the OpenCL implementation on the host.
4327+
* {CL_INVALID_COMMAND_QUEUE}
4328+
** if _command_queue_ is not a valid host command-queue
4329+
* {CL_INVALID_CONTEXT}
4330+
** if the context associated with _command_queue_ and _src_buffer_ are not the same
4331+
** if the context associated with _command_queue_ and _dst_image_ are not the same
4332+
** if the context associated with _command_queue_ and events in _event_wait_list_ are not the same
4333+
* {CL_INVALID_MEM_OBJECT}
4334+
** if _src_buffer_ is not a valid buffer object
4335+
** if _dst_image_ is not a valid image object
4336+
** if _dst_image_ is a 1D image buffer object created from _src_buffer_
4337+
* {CL_INVALID_VALUE}
4338+
** if _dst_origin_ is `NULL`
4339+
** if _region_ is `NULL`
4340+
** if the region specified by _src_offset_ and the computed _src_cb_ is out of bounds of _src_buffer_
4341+
** if the 1D, 2D or 3D rectangular region specified by _dst_origin_ and _region_ is out of bounds of _dst_image_
4342+
** if values in _dst_origin_ and _region_ do not follow rules described in the argument description for _dst_origin_ and _region_
43664343
ifdef::cl_khr_mipmap_image[]
4367-
* {CL_INVALID_MIP_LEVEL} if the {cl_khr_mipmap_image_EXT} extension is
4368-
supported, and the mip level specified in _dst_origin_ is not a valid
4369-
level for _dst_image_,
4344+
* {CL_INVALID_MIP_LEVEL}
4345+
** if the {cl_khr_mipmap_image_EXT} extension is supported and the mip level specified in _dst_origin_ is not a valid level for _dst_image_
43704346
endif::cl_khr_mipmap_image[]
4347+
* {CL_INVALID_EVENT_WAIT_LIST}
4348+
** if _event_wait_list_ is `NULL` and _num_events_in_wait_list_ is greater than zero
4349+
** if _event_wait_list_ is not `NULL` and _num_events_in_wait_list_ is zero
4350+
** if event objects in _event_wait_list_ are not valid events
4351+
* {CL_MISALIGNED_SUB_BUFFER_OFFSET}
4352+
** if _src_buffer_ is a sub-buffer object and the offset specified when the
4353+
sub-buffer object was created is not aligned to the
4354+
{CL_DEVICE_MEM_BASE_ADDR_ALIGN} value for the device associated
4355+
with _command_queue_.
4356+
This error code is <<unified-spec, missing before>> version 1.1.
4357+
* {CL_INVALID_IMAGE_SIZE}
4358+
** if the dimensions for _dst_image_, such as the image width or image height,
4359+
are not supported by the device associated with _command_queue_
4360+
* {CL_IMAGE_FORMAT_NOT_SUPPORTED}
4361+
** if the format for _dst_image_, such as the image channel order or image
4362+
channel data type, are not supported by the device associated with
4363+
_command_queue_
4364+
* {CL_MEM_OBJECT_ALLOCATION_FAILURE}
4365+
** if there is a failure to allocate memory for the data store associated with _src_buffer_
4366+
** if there is a failure to allocate memory for the data store associated with _dst_image_
4367+
* {CL_INVALID_OPERATION}
4368+
** if the device associated with _command_queue_ does not support images (the query for {CL_DEVICE_IMAGE_SUPPORT} returns {CL_FALSE})
43714369
ifdef::cl_ext_immutable_memory_objects[]
4372-
* {CL_INVALID_OPERATION} if _dst_image_ was created with {CL_MEM_IMMUTABLE_EXT}.
4370+
** if _dst_image_ was created with {CL_MEM_IMMUTABLE_EXT}
43734371
endif::cl_ext_immutable_memory_objects[]
4372+
* {CL_OUT_OF_RESOURCES}
4373+
** if there is a failure to allocate resources required by the OpenCL
4374+
implementation on the device
4375+
* {CL_OUT_OF_HOST_MEMORY}
4376+
** if there is a failure to allocate resources required by the OpenCL
4377+
implementation on the host
43744378
--
43754379

43764380

0 commit comments

Comments
 (0)