@@ -594,6 +594,39 @@ include::{generated}/api/version-notes/CL_MEM_DEVICE_HANDLE_LIST_KHR.asciidoc[]
594
594
{CL_MEM_DEVICE_HANDLE_LIST_END_KHR_anchor}) to associate with the
595
595
external memory handle.
596
596
endif::cl_khr_external_memory[]
597
+
598
+ ifdef::cl_ext_buffer_device_address[]
599
+
600
+ | {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT_anchor}
601
+
602
+ include::{generated}/api/version-notes/CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT.asciidoc[]
603
+ | {cl_bool_TYPE}
604
+ | When set to CL_TRUE, specifies that the buffer must have a single fixed
605
+ device-side address for its lifetime, and the address can be queried via {clGetMemObjectInfo}.
606
+
607
+ Each device in the context can have their own (fixed) device-side address and
608
+ a copy of the created buffer which are synchronized
609
+ implicitly by the runtime.
610
+
611
+ The flag might imply that the buffer will be "pinned" permanently to
612
+ a device's memory, but might not be necessarily so, as long as the address
613
+ range of the buffer remains constant.
614
+
615
+ The device addresses of sub-buffers derived from {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT}
616
+ allocated buffers can be computed by adding the sub-buffer origin to the
617
+ device-specific start address.
618
+
619
+ | {CL_MEM_DEVICE_SHARED_ADDRESS_EXT_anchor}
620
+
621
+ include::{generated}/api/version-notes/CL_MEM_DEVICE_SHARED_ADDRESS_EXT.asciidoc[]
622
+ | {cl_bool_TYPE}
623
+ | When set to CL_TRUE, the buffer has otherwise the same properties as
624
+ when allocated using the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT_anchor} flag,
625
+ but with an additional property that the buffer's address is the same across
626
+ all the devices in the context.
627
+
628
+ endif::cl_ext_buffer_device_address[]
629
+
597
630
|====
598
631
599
632
ifdef::cl_khr_external_memory[]
@@ -660,6 +693,15 @@ ifdef::cl_khr_external_memory[]
660
693
** if _properties_ does not include a supported external memory handle and
661
694
{CL_MEM_DEVICE_HANDLE_LIST_KHR} is specified as part of _properties_.
662
695
endif::cl_khr_external_memory[]
696
+ ifdef::cl_ext_buffer_device_address[]
697
+ * {CL_INVALID_DEVICE}
698
+ ** If _properties_ includes either {CL_MEM_DEVICE_SHARED_ADDRESS_EXT} or
699
+ {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} and there is at least one device in
700
+ the context that doesn't support such allocation.
701
+ * {CL_INVALID_VALUE}
702
+ ** If _properties_ includes both {CL_MEM_DEVICE_SHARED_ADDRESS_EXT} and
703
+ {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} at the same time.
704
+ endif::cl_ext_buffer_device_address[]
663
705
664
706
[[memory-flags-table]]
665
707
.List of supported memory flag values
@@ -6149,6 +6191,21 @@ include::{generated}/api/version-notes/CL_MEM_D3D11_RESOURCE_KHR.asciidoc[]
6149
6191
returns the _resource_ argument specified when _memobj_ was created.
6150
6192
endif::cl_khr_d3d11_sharing[]
6151
6193
6194
+ ifdef::cl_ext_buffer_device_address[]
6195
+ | {CL_MEM_DEVICE_ADDRESS_EXT_anchor}
6196
+
6197
+ include::{generated}/api/version-notes/CL_MEM_DEVICE_ADDRESS_EXT.asciidoc[]
6198
+ | {cl_mem_device_address_EXT_TYPE}[]
6199
+ | If _memobj_ was created using {clCreateBufferWithProperties} with
6200
+ the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property set to CL_TRUE,
6201
+ returns a list of device addresses for the buffer, one for each
6202
+ device in the context. If the buffer was allocated
6203
+ with the {CL_MEM_DEVICE_SHARED_ADDRESS_EXT} property,
6204
+ only one device address is returned.
6205
+
6206
+ endif::cl_ext_buffer_device_address[]
6207
+
6208
+
6152
6209
|====
6153
6210
6154
6211
// refError
@@ -6158,6 +6215,12 @@ successfully.
6158
6215
Otherwise, it returns one of the following errors:
6159
6216
6160
6217
* {CL_INVALID_MEM_OBJECT} if _memobj_ is a not a valid memory object.
6218
+ ifdef::cl_ext_buffer_device_address[]
6219
+ ** Returned for the {CL_MEM_DEVICE_ADDRESS_EXT} query if
6220
+ the {cl_ext_buffer_device_address_EXT} is not supported or if the
6221
+ buffer was not allocated with neither {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} or
6222
+ {CL_MEM_DEVICE_SHARED_ADDRESS_EXT}.
6223
+ endif::cl_ext_buffer_device_address[]
6161
6224
* {CL_INVALID_VALUE} if _param_name_ is not valid, or if size in bytes
6162
6225
specified by _param_value_size_ is < size of return type as described in
6163
6226
the <<mem-info-table,Memory Object Info>> table and _param_value_ is not
@@ -10454,6 +10517,48 @@ Otherwise, it returns one of the following errors:
10454
10517
required by the OpenCL implementation on the host.
10455
10518
--
10456
10519
10520
+ ifdef::cl_ext_buffer_device_address[]
10521
+ [open,refpage='clSetKernelArgDevicePointerEXT',desc='Set a device pointer as the argument value for a specific argument of a kernel.',type='protos']
10522
+ --
10523
+ To set a device pointer as the argument value for a specific argument of a
10524
+ kernel, call the function
10525
+
10526
+ include::{generated}/api/protos/clSetKernelArgDevicePointerEXT.txt[]
10527
+ include::{generated}/api/version-notes/clSetKernelArgDevicePointerEXT.asciidoc[]
10528
+
10529
+ * _kernel_ is a valid kernel object.
10530
+ * _arg_index_ is the argument index.
10531
+ Arguments to the kernel are referred by indices that go from 0 for the
10532
+ leftmost argument to _n_ - 1, where _n_ is the total number of arguments
10533
+ declared by a kernel.
10534
+ * _arg_value_ is the device pointer that should be used as the argument value for
10535
+ argument specified by _arg_index_.
10536
+ The device pointer specified is the value used by all API calls that enqueue
10537
+ _kernel_ ({clEnqueueNDRangeKernel} and {clEnqueueTask}) until the argument
10538
+ value is changed by a call to {clSetKernelArgDevicePointerEXT} for _kernel_.
10539
+ The device pointer can only be used for arguments that are declared to be a
10540
+ pointer to `global` memory allocated with {clCreateBufferWithProperties} with
10541
+ either the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} or {CL_MEM_DEVICE_SHARED_ADDRESS_EXT}
10542
+ property. The pointer value specified as the argument value
10543
+ can be the pointer to the beginning of the buffer or any offset into
10544
+ the buffer region. The device pointer value must be naturally aligned according to
10545
+ the argument's type.
10546
+
10547
+ {clSetKernelArgDevicePointerEXT} returns {CL_SUCCESS} if the argument was set
10548
+ successfully. Otherwise, it returns one of the following errors:
10549
+
10550
+ * {CL_INVALID_KERNEL} if _kernel_ is not a valid kernel object.
10551
+ * {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support
10552
+ the device pointer.
10553
+ * {CL_INVALID_ARG_INDEX} if _arg_index_ is not a valid argument index.
10554
+ * {CL_INVALID_ARG_VALUE} if _arg_value_ specified is not a valid value.
10555
+ * {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
10556
+ by the OpenCL implementation on the device.
10557
+ * {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
10558
+ required by the OpenCL implementation on the host.
10559
+ --
10560
+ endif::cl_ext_buffer_device_address[]
10561
+
10457
10562
[open,refpage='clSetKernelExecInfo',desc='Pass additional information other than argument values to a kernel.',type='protos']
10458
10563
--
10459
10564
To pass additional information other than argument values to a kernel, call
@@ -10497,6 +10602,19 @@ include::{generated}/api/version-notes/CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
10497
10602
grain system SVM allocations.
10498
10603
These fine grain system SVM pointers may be passed as arguments or
10499
10604
defined in SVM buffers that are passed as arguments to _kernel_.
10605
+
10606
+ ifdef::cl_ext_buffer_device_address[]
10607
+ | {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT_anchor}
10608
+
10609
+ include::{generated}/api/version-notes/CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT.asciidoc[]
10610
+ | {cl_mem_device_address_EXT_TYPE}[]
10611
+ | Device pointers must reference locations contained entirely within
10612
+ buffers that are passed to kernel as arguments, or that are passed
10613
+ through the execution information. Non-argument device pointers accessed
10614
+ by the kernel must be specified by passing pointers to those buffers
10615
+ via this {clSetKernelExecInfo} option.
10616
+ endif::cl_ext_buffer_device_address[]
10617
+
10500
10618
|====
10501
10619
10502
10620
// refError
@@ -10506,7 +10624,13 @@ successfully.
10506
10624
Otherwise, it returns one of the following errors:
10507
10625
10508
10626
* {CL_INVALID_KERNEL} if _kernel_ is a not a valid kernel object.
10509
- * {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support SVM.
10627
+ * {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_SVM_PTRS} if no devices in
10628
+ the context associated with _kernel_ support SVM.
10629
+ ifdef::cl_ext_buffer_device_address[]
10630
+ * {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT} if no
10631
+ device in the context associated with _kernel_ support device pointers.
10632
+ endif::cl_ext_buffer_device_address[]
10633
+
10510
10634
* {CL_INVALID_VALUE} if _param_name_ is not valid, if _param_value_ is
10511
10635
`NULL` or if the size specified by _param_value_size_ is not valid.
10512
10636
* {CL_INVALID_OPERATION} if _param_name_ is
0 commit comments