Skip to content

Commit

Permalink
improve param_value_size consistency (#1254)
Browse files Browse the repository at this point in the history
* fix descriptions of param_value_size for consistency

Still need to check and update error conditions for consistency.

* improve consistency for error descriptions too

* fix CL_INVALID_VALUE error for clGetGLContextInfoKHR
  • Loading branch information
bashbaug authored Oct 8, 2024
1 parent a32b1ca commit d65b739
Show file tree
Hide file tree
Showing 2 changed files with 255 additions and 227 deletions.
70 changes: 35 additions & 35 deletions api/opencl_platform_layer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ include::{generated}/api/version-notes/clGetPlatformInfo.asciidoc[]
If _param_value_ is `NULL`, it is ignored.
* _param_value_size_ specifies the size in bytes of memory pointed to by
_param_value_.
This size in bytes must be {geq} size of return type specified in the
<<platform-queries-table, Platform Queries>> table.
This size must be greater than or equal to the size of the return type
specified in the <<platform-queries-table, Platform Queries>> table.
If _param_value_ is `NULL`, it is ignored.
* _param_value_size_ret_ returns the actual size in bytes of data being
queried by _param_name_.
If _param_value_size_ret_ is `NULL`, it is ignored.
Expand Down Expand Up @@ -311,10 +312,11 @@ Otherwise, it returns one of the following
errors footnote:[{fn-error-precedence}].

* {CL_INVALID_PLATFORM} if _platform_ is not a valid platform.
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values or
if size in bytes specified by _param_value_size_ is < size of return
type as specified in the <<platform-queries-table,OpenCL Platform
Queries>> table, and _param_value_ is not a `NULL` value.
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values, or
if the size in bytes specified by _param_value_size_ is less than size of
the return type specified in the
<<platform-queries-table, Platform Queries>> table
and _param_value_ is not `NULL`.
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
required by the OpenCL implementation on the host.
--
Expand Down Expand Up @@ -454,8 +456,9 @@ include::{generated}/api/version-notes/clGetDeviceInfo.asciidoc[]
If _param_value_ is `NULL`, it is ignored.
* _param_value_size_ specifies the size in bytes of memory pointed to by
_param_value_.
This size in bytes must be {geq} size of return type specified in the
<<device-queries-table, Device Queries>> table.
This size must be greater than or equal to the size of the return type
specified in the <<device-queries-table, Device Queries>> table.
If _param_value_ is `NULL`, it is ignored.
* _param_value_size_ret_ returns the actual size in bytes of data being
queried by _param_name_.
If _param_value_size_ret_ is `NULL`, it is ignored.
Expand Down Expand Up @@ -2162,12 +2165,11 @@ successfully.
Otherwise, it returns one of the following errors:

* {CL_INVALID_DEVICE} if _device_ is not a valid device.
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values or
if size in bytes specified by _param_value_size_ is < size of return
type as specified in the <<device-queries-table, Device Queries>> table
and _param_value_ is not a `NULL` value or if _param_name_ is a value
that is available as an extension and the corresponding extension is not
supported by the device.
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values, or
if the size in bytes specified by _param_value_size_ is less than size of
the return type specified in the
<<device-queries-table, Device Queries>> table
and _param_value_ is not `NULL`.
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
by the OpenCL implementation on the device.
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
Expand Down Expand Up @@ -2459,17 +2461,15 @@ include::{generated}/api/version-notes/clGetDeviceIDsFromD3D10KHR.asciidoc[]

* _platform_ refers to the platform ID returned by {clGetPlatformIDs}.
* _d3d_device_source_ specifies the type of _d3d_object_, and must be one
of the values shown in the <<d3d10-device-object-types-table, Direct3D
10 object types that may be used by {clGetDeviceIDsFromD3D10KHR}>>
table.
of the values shown in the
<<d3d10-device-object-types-table, Direct3D 10 Object Types>> table.
* _d3d_object_ specifies the object whose corresponding OpenCL devices are
being queried.
The type of _d3d_object_ must be as specified in the
<<d3d10-device-object-types-table, Direct3D 10 object types that may be
used by {clGetDeviceIDsFromD3D10KHR}>> table.
<<d3d10-device-object-types-table, Direct3D 10 Object Types>> table.
* _d3d_device_set_ specifies the set of devices to return, and must be one
of the values shown in the <<d3d10-device-sets-table, Sets of devices
queriable using {clGetDeviceIDsFromD3D10KHR}>> table.
of the values shown in the
<<d3d10-device-sets-table, Direct3D 10 Device Sets>> table.
* _num_entries_ is the number of {cl_device_id_TYPE} entries that can be
added to _devices_.
If _devices_ is not `NULL` then _num_entries_ must be greater than zero.
Expand Down Expand Up @@ -2566,17 +2566,15 @@ include::{generated}/api/version-notes/clGetDeviceIDsFromD3D11KHR.asciidoc[]

* _platform_ refers to the platform ID returned by {clGetPlatformIDs}.
* _d3d_device_source_ specifies the type of _d3d_object_, and must be one
of the values shown in the <<d3d11-device-object-types-table, Direct3D
11 object types that may be used by {clGetDeviceIDsFromD3D11KHR}>>
table.
of the values shown in the
<<d3d11-device-object-types-table, Direct3D 11 Object Types>> table.
* _d3d_object_ specifies the object whose corresponding OpenCL devices are
being queried.
The type of _d3d_object_ must be as specified in the
<<d3d11-device-object-types-table, Direct3D 11 object types that may be
used by {clGetDeviceIDsFromD3D11KHR}>> table.
<<d3d11-device-object-types-table, Direct3D 11 Object Types>> table.
* _d3d_device_set_ specifies the set of devices to return, and must be one
of the values shown in the <<d3d11-device-sets-table, Sets of devices
queriable using {clGetDeviceIDsFromD3D11KHR}>> table.
of the values shown in the
<<d3d11-device-sets-table, Direct3D 11 Device Sets>> table.
* _num_entries_ is the number of {cl_device_id_TYPE} entries that can be
added to _devices_.
If _devices_ is not `NULL` then _num_entries_ must be greater than zero.
Expand Down Expand Up @@ -3505,15 +3503,16 @@ include::{generated}/api/version-notes/clGetContextInfo.asciidoc[]
If _param_value_ is `NULL`, it is ignored.
* _param_value_size_ specifies the size in bytes of memory pointed to by
_param_value_.
This size must be greater than or equal to the size of return type as
described in the <<context-info-table, Context Attributes>> table.
This size must be greater than or equal to the size of the return type
specified in the <<context-info-table, Context Queries>> table.
If _param_value_ is `NULL`, it is ignored.
* _param_value_size_ret_ returns the actual size in bytes of data being
queried by _param_name_.
If _param_value_size_ret_ is `NULL`, it is ignored.

The list of supported _param_name_ values and the information returned in
_param_value_ by {clGetContextInfo} is described in the
<<context-info-table, Context Attributes>> table.
<<context-info-table, Context Queries>> table.

[[context-info-table]]
.List of supported param_names by {clGetContextInfo}
Expand Down Expand Up @@ -3586,10 +3585,11 @@ successfully.
Otherwise, it returns one of the following errors:

* {CL_INVALID_CONTEXT} if _context_ is not a valid context.
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values or
if size in bytes specified by _param_value_size_ is < size of return
type as specified in the <<context-info-table, Context Attributes>>
table and _param_value_ is not a `NULL` value.
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values, or
if the size in bytes specified by _param_value_size_ is less than size of
the return type specified in the
<<context-info-table, Context Queries>> table
and _param_value_ is not `NULL`.
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
by the OpenCL implementation on the device.
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
Expand Down
Loading

0 comments on commit d65b739

Please sign in to comment.