@@ -595,6 +595,39 @@ include::{generated}/api/version-notes/CL_MEM_DEVICE_HANDLE_LIST_KHR.asciidoc[]
595595 {CL_MEM_DEVICE_HANDLE_LIST_END_KHR_anchor}) to associate with the
596596 external memory handle.
597597endif::cl_khr_external_memory[]
598+
599+ ifdef::cl_ext_buffer_device_address[]
600+
601+ | {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT_anchor}
602+
603+ include::{generated}/api/version-notes/CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT.asciidoc[]
604+ | {cl_bool_TYPE}
605+ | When set to CL_TRUE, specifies that the buffer must have a single fixed
606+ device-side address for its lifetime, and the address can be queried via {clGetMemObjectInfo}.
607+
608+ Each device in the context can have their own (fixed) device-side address and
609+ a copy of the created buffer which are synchronized
610+ implicitly by the runtime.
611+
612+ The flag might imply that the buffer will be "pinned" permanently to
613+ a device's memory, but might not be necessarily so, as long as the address
614+ range of the buffer remains constant.
615+
616+ The device addresses of sub-buffers derived from {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT}
617+ allocated buffers can be computed by adding the sub-buffer origin to the
618+ device-specific start address.
619+
620+ | {CL_MEM_DEVICE_SHARED_ADDRESS_EXT_anchor}
621+
622+ include::{generated}/api/version-notes/CL_MEM_DEVICE_SHARED_ADDRESS_EXT.asciidoc[]
623+ | {cl_bool_TYPE}
624+ | When set to CL_TRUE, the buffer has otherwise the same properties as
625+ when allocated using the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT_anchor} flag,
626+ but with an additional property that the buffer's address is the same across
627+ all the devices in the context.
628+
629+ endif::cl_ext_buffer_device_address[]
630+
598631|====
599632
600633ifdef::cl_khr_external_memory[]
@@ -662,6 +695,15 @@ ifdef::cl_khr_external_memory[]
662695 {CL_MEM_DEVICE_HANDLE_LIST_KHR} is specified as part of _properties_.
663696 ** if _properties_ includes more than one external memory handle.
664697endif::cl_khr_external_memory[]
698+ ifdef::cl_ext_buffer_device_address[]
699+ * {CL_INVALID_DEVICE}
700+ ** If _properties_ includes either {CL_MEM_DEVICE_SHARED_ADDRESS_EXT} or
701+ {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} and there is at least one device in
702+ the context that doesn't support such allocation.
703+ * {CL_INVALID_VALUE}
704+ ** If _properties_ includes both {CL_MEM_DEVICE_SHARED_ADDRESS_EXT} and
705+ {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} at the same time.
706+ endif::cl_ext_buffer_device_address[]
665707
666708[[memory-flags-table]]
667709.List of supported memory flag values
@@ -6374,6 +6416,21 @@ include::{generated}/api/version-notes/CL_MEM_D3D11_RESOURCE_KHR.asciidoc[]
63746416 returns the _resource_ argument specified when _memobj_ was created.
63756417endif::cl_khr_d3d11_sharing[]
63766418
6419+ ifdef::cl_ext_buffer_device_address[]
6420+ | {CL_MEM_DEVICE_ADDRESS_EXT_anchor}
6421+
6422+ include::{generated}/api/version-notes/CL_MEM_DEVICE_ADDRESS_EXT.asciidoc[]
6423+ | {cl_mem_device_address_EXT_TYPE}[]
6424+ | If _memobj_ was created using {clCreateBufferWithProperties} with
6425+ the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property set to CL_TRUE,
6426+ returns a list of device addresses for the buffer, one for each
6427+ device in the context. If the buffer was allocated
6428+ with the {CL_MEM_DEVICE_SHARED_ADDRESS_EXT} property,
6429+ only one device address is returned.
6430+
6431+ endif::cl_ext_buffer_device_address[]
6432+
6433+
63776434|====
63786435
63796436// refError
@@ -6388,6 +6445,12 @@ Otherwise, it returns one of the following errors:
63886445 the return type specified in the
63896446 <<mem-info-table, Memory Object Queries>> table
63906447 and _param_value_ is not `NULL`.
6448+ ifdef::cl_ext_buffer_device_address[]
6449+ ** Returned for the {CL_MEM_DEVICE_ADDRESS_EXT} query if
6450+ the {cl_ext_buffer_device_address_EXT} is not supported or if the
6451+ buffer was not allocated with neither {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} or
6452+ {CL_MEM_DEVICE_SHARED_ADDRESS_EXT}.
6453+ endif::cl_ext_buffer_device_address[]
63916454 * {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
63926455 by the OpenCL implementation on the device.
63936456 * {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
@@ -10689,6 +10752,48 @@ Otherwise, it returns one of the following errors:
1068910752 required by the OpenCL implementation on the host.
1069010753--
1069110754
10755+ ifdef::cl_ext_buffer_device_address[]
10756+ [open,refpage='clSetKernelArgDevicePointerEXT',desc='Set a device pointer as the argument value for a specific argument of a kernel.',type='protos']
10757+ --
10758+ To set a device pointer as the argument value for a specific argument of a
10759+ kernel, call the function
10760+
10761+ include::{generated}/api/protos/clSetKernelArgDevicePointerEXT.txt[]
10762+ include::{generated}/api/version-notes/clSetKernelArgDevicePointerEXT.asciidoc[]
10763+
10764+ * _kernel_ is a valid kernel object.
10765+ * _arg_index_ is the argument index.
10766+ Arguments to the kernel are referred by indices that go from 0 for the
10767+ leftmost argument to _n_ - 1, where _n_ is the total number of arguments
10768+ declared by a kernel.
10769+ * _arg_value_ is the device pointer that should be used as the argument value for
10770+ argument specified by _arg_index_.
10771+ The device pointer specified is the value used by all API calls that enqueue
10772+ _kernel_ ({clEnqueueNDRangeKernel} and {clEnqueueTask}) until the argument
10773+ value is changed by a call to {clSetKernelArgDevicePointerEXT} for _kernel_.
10774+ The device pointer can only be used for arguments that are declared to be a
10775+ pointer to `global` memory allocated with {clCreateBufferWithProperties} with
10776+ either the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} or {CL_MEM_DEVICE_SHARED_ADDRESS_EXT}
10777+ property. The pointer value specified as the argument value
10778+ can be the pointer to the beginning of the buffer or any offset into
10779+ the buffer region. The device pointer value must be naturally aligned according to
10780+ the argument's type.
10781+
10782+ {clSetKernelArgDevicePointerEXT} returns {CL_SUCCESS} if the argument was set
10783+ successfully. Otherwise, it returns one of the following errors:
10784+
10785+ * {CL_INVALID_KERNEL} if _kernel_ is not a valid kernel object.
10786+ * {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support
10787+ the device pointer.
10788+ * {CL_INVALID_ARG_INDEX} if _arg_index_ is not a valid argument index.
10789+ * {CL_INVALID_ARG_VALUE} if _arg_value_ specified is not a valid value.
10790+ * {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
10791+ by the OpenCL implementation on the device.
10792+ * {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
10793+ required by the OpenCL implementation on the host.
10794+ --
10795+ endif::cl_ext_buffer_device_address[]
10796+
1069210797[open,refpage='clSetKernelExecInfo',desc='Set additional execution information for a kernel.',type='protos']
1069310798--
1069410799To set additional execution information for a kernel, call the function
@@ -10755,6 +10860,19 @@ include::{generated}/api/version-notes/CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
1075510860 If {clSetKernelExecInfo} has not been called with a value for
1075610861 {CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM}, the default value is
1075710862 {CL_TRUE}.
10863+
10864+ ifdef::cl_ext_buffer_device_address[]
10865+ | {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT_anchor}
10866+
10867+ include::{generated}/api/version-notes/CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT.asciidoc[]
10868+ | {cl_mem_device_address_EXT_TYPE}[]
10869+ | Device pointers must reference locations contained entirely within
10870+ buffers that are passed to kernel as arguments, or that are passed
10871+ through the execution information. Non-argument device pointers accessed
10872+ by the kernel must be specified by passing pointers to those buffers
10873+ via this {clSetKernelExecInfo} option.
10874+ endif::cl_ext_buffer_device_address[]
10875+
1075810876|====
1075910877
1076010878// refError
@@ -10764,7 +10882,14 @@ successfully.
1076410882Otherwise, it returns one of the following errors:
1076510883
1076610884 * {CL_INVALID_KERNEL} if _kernel_ is a not a valid kernel object.
10767- * {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support SVM.
10885+ * {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_SVM_PTRS} if no devices in
10886+ the context associated with _kernel_ support SVM.
10887+ ifdef::cl_ext_buffer_device_address[]
10888+ * {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT} if no
10889+ device in the context associated with _kernel_ support device pointers.
10890+ endif::cl_ext_buffer_device_address[]
10891+ * {CL_INVALID_VALUE} if _param_name_ is not valid, if _param_value_ is
10892+ `NULL` or if the size specified by _param_value_size_ is not valid.
1076810893 * {CL_INVALID_OPERATION} if _param_name_ is
1076910894 {CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM} and _param_value_ is {CL_TRUE}
1077010895 and no devices in the context associated with _kernel_ support fine-grain
0 commit comments