Skip to content

Commit 5015843

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 7a28bf3 commit 5015843

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]]
@@ -6503,9 +6504,10 @@ ifdef::cl_ext_buffer_device_address[]
65036504
include::{generated}/api/version-notes/CL_MEM_DEVICE_ADDRESS_EXT.asciidoc[]
65046505
| {cl_mem_device_address_EXT_TYPE}[]
65056506
| If _memobj_ was created using {clCreateBufferWithProperties} with
6506-
the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property set to CL_TRUE,
6507+
the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property set to {CL_TRUE},
65076508
returns a list of device addresses for the buffer, one for each
6508-
device in the context.
6509+
device in the context in the same order as the list of devices
6510+
passed to {clCreateContext}.
65096511

65106512
endif::cl_ext_buffer_device_address[]
65116513

@@ -6519,16 +6521,16 @@ successfully.
65196521
Otherwise, it returns one of the following errors:
65206522

65216523
* {CL_INVALID_MEM_OBJECT} if _memobj_ is a not a valid memory object.
6524+
ifdef::cl_ext_buffer_device_address[]
6525+
* {CL_INVALID_OPERATION} is returned for the {CL_MEM_DEVICE_ADDRESS_EXT} query if
6526+
the {cl_ext_buffer_device_address_EXT} is not supported or if the
6527+
buffer was not allocated with {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT}.
6528+
endif::cl_ext_buffer_device_address[]
65226529
* {CL_INVALID_VALUE} if _param_name_ is not one of the supported values, or
65236530
if the size in bytes specified by _param_value_size_ is less than size of
65246531
the return type specified in the
65256532
<<mem-info-table, Memory Object Queries>> table
65266533
and _param_value_ is not `NULL`.
6527-
ifdef::cl_ext_buffer_device_address[]
6528-
** Returned for the {CL_MEM_DEVICE_ADDRESS_EXT} query if
6529-
the {cl_ext_buffer_device_address_EXT} is not supported or if the
6530-
buffer was not allocated with {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT}.
6531-
endif::cl_ext_buffer_device_address[]
65326534
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
65336535
by the OpenCL implementation on the device.
65346536
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
@@ -10854,16 +10856,17 @@ include::{generated}/api/version-notes/clSetKernelArgDevicePointerEXT.asciidoc[]
1085410856
the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property. The pointer value specified as
1085510857
the argument value can be the pointer to the beginning of the buffer or any offset into
1085610858
the buffer region. The device pointer value must be naturally aligned according to
10857-
the argument's type.
10859+
the argument's type. It should be noted that it's legal to pass invalid
10860+
pointers as the value (similarly to C/C++ function calls with pointer arguments) as
10861+
long as the kernel doesn't dereference the pointer.
1085810862

1085910863
{clSetKernelArgDevicePointerEXT} returns {CL_SUCCESS} if the argument was set
1086010864
successfully. Otherwise, it returns one of the following errors:
1086110865

1086210866
* {CL_INVALID_KERNEL} if _kernel_ is not a valid kernel object.
1086310867
* {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support
10864-
the device pointer.
10868+
the {cl_ext_buffer_device_address_EXT} extension.
1086510869
* {CL_INVALID_ARG_INDEX} if _arg_index_ is not a valid argument index.
10866-
* {CL_INVALID_ARG_VALUE} if _arg_value_ specified is not a valid value.
1086710870
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
1086810871
by the OpenCL implementation on the device.
1086910872
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
@@ -10964,7 +10967,8 @@ Otherwise, it returns one of the following errors:
1096410967
the context associated with _kernel_ support SVM.
1096510968
ifdef::cl_ext_buffer_device_address[]
1096610969
* {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT} if no
10967-
device in the context associated with _kernel_ support device pointers.
10970+
device in the context associated with _kernel_ support the {cl_ext_buffer_device_address_EXT}
10971+
extension.
1096810972
endif::cl_ext_buffer_device_address[]
1096910973
* {CL_INVALID_VALUE} if _param_name_ is not valid, if _param_value_ is
1097010974
`NULL` or if the size specified by _param_value_size_ is not valid.

0 commit comments

Comments
 (0)