Skip to content

Commit e5fa28a

Browse files
author
Pekka Jääskeläinen
committed
cl_ext_buffer_device_address: Revision 1.0.1
* Made it explicit that passing illegal pointers is legal as long as they are not referenced. * Removed CL_INVALID_ARG_VALUE as a possible error in clSetKernelArgDevicePointerEXT() as there are no illegal pointer cases when calling this function. Return CL_INVALID_OPERATION for clGetMemObjectInfo() if the pointer is not a buffer device pointer. * clSetKernelExecInfo() and clSetKernelArgDevicePointerEXT() now only error out if no devices in the context associated with kernel support device pointers.
1 parent 676312c commit e5fa28a

2 files changed

Lines changed: 31 additions & 18 deletions

File tree

api/cl_ext_buffer_device_address.asciidoc

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ include::{generated}/meta/{refprefix}cl_ext_buffer_device_address.txt[]
66
=== Other Extension Metadata
77

88
*Last Modified Date*::
9-
2025-01-15
9+
2025-01-28
1010
*IP Status*::
1111
No known IP claims.
1212
*Contributors*::
1313
- Pekka Jääskeläinen, Intel +
1414
- Karol Herbst, Red Hat +
15-
- Henry Linjamäki, Intel +
16-
- Kevin Petit, Arm +
1715
- Ben Ashbaugh, Intel +
16+
- Kevin Petit, Arm +
17+
- Henry Linjamäki, Intel +
1818

1919
=== Description
2020

@@ -64,4 +64,13 @@ can allocate.
6464
=== Version History
6565

6666
* Revision 1.0.0, 2025-01-15
67-
** Initial version.
67+
** Initial version for detailed review.
68+
* Revision 1.0.1, 2025-01-28
69+
** Made it explicit that passing illegal pointers is legal as long as they are
70+
not referenced. Removed CL_INVALID_ARG_VALUE as a possible error in
71+
clSetKernelArgDevicePointerEXT() as there are no illegal pointer
72+
cases when calling this function. Return CL_INVALID_OPERATION for
73+
clGetMemObjectInfo() if the pointer is not a buffer device pointer.
74+
clSetKernelExecInfo() and clSetKernelArgDevicePointerEXT() now only
75+
error out if no devices in the context associated with kernel support
76+
device pointers.

api/opencl_runtime_layer.asciidoc

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ ifdef::cl_ext_buffer_device_address[]
602602

603603
include::{generated}/api/version-notes/CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT.asciidoc[]
604604
| {cl_bool_TYPE}
605-
| When set to CL_TRUE, specifies that the buffer must have a single fixed
605+
| When set to {CL_TRUE}, specifies that the buffer must have a single fixed
606606
device-side address for its lifetime, and the address can be queried via {clGetMemObjectInfo}.
607607

608608
Each device in the context can have their own (fixed) device-side address and
@@ -692,9 +692,10 @@ ifdef::cl_khr_external_memory[]
692692
** if _properties_ includes more than one external memory handle.
693693
endif::cl_khr_external_memory[]
694694
ifdef::cl_ext_buffer_device_address[]
695-
* {CL_INVALID_DEVICE}
695+
* {CL_INVALID_OPERATION}
696696
** If _properties_ includes {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} and there
697-
is at least one device in the context that doesn't support such allocation.
697+
are no devices in the context that support the {cl_ext_buffer_device_address_EXT}
698+
extension.
698699
endif::cl_ext_buffer_device_address[]
699700

700701
[[memory-flags-table]]
@@ -6414,9 +6415,10 @@ ifdef::cl_ext_buffer_device_address[]
64146415
include::{generated}/api/version-notes/CL_MEM_DEVICE_ADDRESS_EXT.asciidoc[]
64156416
| {cl_mem_device_address_EXT_TYPE}[]
64166417
| If _memobj_ was created using {clCreateBufferWithProperties} with
6417-
the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property set to CL_TRUE,
6418+
the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property set to {CL_TRUE},
64186419
returns a list of device addresses for the buffer, one for each
6419-
device in the context.
6420+
device in the context in the same order as the list of devices
6421+
passed to {clCreateContext}.
64206422

64216423
endif::cl_ext_buffer_device_address[]
64226424

@@ -6430,16 +6432,16 @@ successfully.
64306432
Otherwise, it returns one of the following errors:
64316433

64326434
* {CL_INVALID_MEM_OBJECT} if _memobj_ is a not a valid memory object.
6435+
ifdef::cl_ext_buffer_device_address[]
6436+
* {CL_INVALID_OPERATION} is returned for the {CL_MEM_DEVICE_ADDRESS_EXT} query if
6437+
the {cl_ext_buffer_device_address_EXT} is not supported or if the
6438+
buffer was not allocated with {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT}.
6439+
endif::cl_ext_buffer_device_address[]
64336440
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values, or
64346441
if the size in bytes specified by _param_value_size_ is less than size of
64356442
the return type specified in the
64366443
<<mem-info-table, Memory Object Queries>> table
64376444
and _param_value_ is not `NULL`.
6438-
ifdef::cl_ext_buffer_device_address[]
6439-
** Returned for the {CL_MEM_DEVICE_ADDRESS_EXT} query if
6440-
the {cl_ext_buffer_device_address_EXT} is not supported or if the
6441-
buffer was not allocated with {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT}.
6442-
endif::cl_ext_buffer_device_address[]
64436445
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
64446446
by the OpenCL implementation on the device.
64456447
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
@@ -10765,16 +10767,17 @@ include::{generated}/api/version-notes/clSetKernelArgDevicePointerEXT.asciidoc[]
1076510767
the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property. The pointer value specified as
1076610768
the argument value can be the pointer to the beginning of the buffer or any offset into
1076710769
the buffer region. The device pointer value must be naturally aligned according to
10768-
the argument's type.
10770+
the argument's type. It should be noted that it's legal to pass invalid
10771+
pointers as the value (similarly to C/C++ function calls with pointer arguments) as
10772+
long as the kernel doesn't dereference the pointer.
1076910773

1077010774
{clSetKernelArgDevicePointerEXT} returns {CL_SUCCESS} if the argument was set
1077110775
successfully. Otherwise, it returns one of the following errors:
1077210776

1077310777
* {CL_INVALID_KERNEL} if _kernel_ is not a valid kernel object.
1077410778
* {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support
10775-
the device pointer.
10779+
the {cl_ext_buffer_device_address_EXT} extension.
1077610780
* {CL_INVALID_ARG_INDEX} if _arg_index_ is not a valid argument index.
10777-
* {CL_INVALID_ARG_VALUE} if _arg_value_ specified is not a valid value.
1077810781
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
1077910782
by the OpenCL implementation on the device.
1078010783
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
@@ -10875,7 +10878,8 @@ Otherwise, it returns one of the following errors:
1087510878
the context associated with _kernel_ support SVM.
1087610879
ifdef::cl_ext_buffer_device_address[]
1087710880
* {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT} if no
10878-
device in the context associated with _kernel_ support device pointers.
10881+
device in the context associated with _kernel_ support the {cl_ext_buffer_device_address_EXT}
10882+
extension.
1087910883
endif::cl_ext_buffer_device_address[]
1088010884
* {CL_INVALID_VALUE} if _param_name_ is not valid, if _param_value_ is
1088110885
`NULL` or if the size specified by _param_value_size_ is not valid.

0 commit comments

Comments
 (0)