@@ -595,6 +595,35 @@ 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+ If the device supports SVM and {clCreateBufferWithProperties} is called with a pointer
621+ returned by {clSVMAlloc} as its _host_ptr_ argument, and {CL_MEM_USE_HOST_PTR} is
622+ set in its _flags_ argument, the device-side address is guaranteed to match
623+ the _host_ptr_.
624+
625+ endif::cl_ext_buffer_device_address[]
626+
598627|====
599628
600629ifdef::cl_khr_external_memory[]
@@ -662,6 +691,12 @@ ifdef::cl_khr_external_memory[]
662691 {CL_MEM_DEVICE_HANDLE_LIST_KHR} is specified as part of _properties_.
663692 ** if _properties_ includes more than one external memory handle.
664693endif::cl_khr_external_memory[]
694+ ifdef::cl_ext_buffer_device_address[]
695+ * {CL_INVALID_OPERATION}
696+ ** If _properties_ includes {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} and there
697+ are no devices in the context that support the {cl_ext_buffer_device_address_EXT}
698+ extension.
699+ endif::cl_ext_buffer_device_address[]
665700
666701[[memory-flags-table]]
667702.List of supported memory flag values
@@ -6463,6 +6498,20 @@ include::{generated}/api/version-notes/CL_MEM_D3D11_RESOURCE_KHR.asciidoc[]
64636498 returns the _resource_ argument specified when _memobj_ was created.
64646499endif::cl_khr_d3d11_sharing[]
64656500
6501+ ifdef::cl_ext_buffer_device_address[]
6502+ | {CL_MEM_DEVICE_ADDRESS_EXT_anchor}
6503+
6504+ include::{generated}/api/version-notes/CL_MEM_DEVICE_ADDRESS_EXT.asciidoc[]
6505+ | {cl_mem_device_address_EXT_TYPE}[]
6506+ | If _memobj_ was created using {clCreateBufferWithProperties} with
6507+ the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property set to {CL_TRUE},
6508+ returns a list of device addresses for the buffer, one for each
6509+ device in the context in the same order as the list of devices
6510+ passed to {clCreateContext}.
6511+
6512+ endif::cl_ext_buffer_device_address[]
6513+
6514+
64666515|====
64676516
64686517// refError
@@ -6472,6 +6521,11 @@ successfully.
64726521Otherwise, it returns one of the following errors:
64736522
64746523 * {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[]
64756529 * {CL_INVALID_VALUE} if _param_name_ is not one of the supported values, or
64766530 if the size in bytes specified by _param_value_size_ is less than size of
64776531 the return type specified in the
@@ -10778,6 +10832,48 @@ Otherwise, it returns one of the following errors:
1077810832 required by the OpenCL implementation on the host.
1077910833--
1078010834
10835+ ifdef::cl_ext_buffer_device_address[]
10836+ [open,refpage='clSetKernelArgDevicePointerEXT',desc='Set a device pointer as the argument value for a specific argument of a kernel.',type='protos']
10837+ --
10838+ To set a device pointer as the argument value for a specific argument of a
10839+ kernel, call the function
10840+
10841+ include::{generated}/api/protos/clSetKernelArgDevicePointerEXT.txt[]
10842+ include::{generated}/api/version-notes/clSetKernelArgDevicePointerEXT.asciidoc[]
10843+
10844+ * _kernel_ is a valid kernel object.
10845+ * _arg_index_ is the argument index.
10846+ Arguments to the kernel are referred by indices that go from 0 for the
10847+ leftmost argument to _n_ - 1, where _n_ is the total number of arguments
10848+ declared by a kernel.
10849+ * _arg_value_ is the device pointer that should be used as the argument value for
10850+ argument specified by _arg_index_.
10851+ The device pointer specified is the value used by all API calls that enqueue
10852+ _kernel_ ({clEnqueueNDRangeKernel} and {clEnqueueTask}) until the argument
10853+ value is changed by a call to {clSetKernelArgDevicePointerEXT} for _kernel_.
10854+ The device pointer can only be used for arguments that are declared to be a
10855+ pointer to `global` memory allocated with {clCreateBufferWithProperties} with
10856+ the {CL_MEM_DEVICE_PRIVATE_ADDRESS_EXT} property. The pointer value specified as
10857+ the argument value can be the pointer to the beginning of the buffer or any offset into
10858+ the buffer region. The device pointer value must be naturally aligned according to
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.
10862+
10863+ {clSetKernelArgDevicePointerEXT} returns {CL_SUCCESS} if the argument was set
10864+ successfully. Otherwise, it returns one of the following errors:
10865+
10866+ * {CL_INVALID_KERNEL} if _kernel_ is not a valid kernel object.
10867+ * {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support
10868+ the {cl_ext_buffer_device_address_EXT} extension.
10869+ * {CL_INVALID_ARG_INDEX} if _arg_index_ is not a valid argument index.
10870+ * {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required
10871+ by the OpenCL implementation on the device.
10872+ * {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
10873+ required by the OpenCL implementation on the host.
10874+ --
10875+ endif::cl_ext_buffer_device_address[]
10876+
1078110877[open,refpage='clSetKernelExecInfo',desc='Set additional execution information for a kernel.',type='protos']
1078210878--
1078310879To set additional execution information for a kernel, call the function
@@ -10844,6 +10940,19 @@ include::{generated}/api/version-notes/CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM
1084410940 If {clSetKernelExecInfo} has not been called with a value for
1084510941 {CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM}, the default value is
1084610942 {CL_TRUE}.
10943+
10944+ ifdef::cl_ext_buffer_device_address[]
10945+ | {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT_anchor}
10946+
10947+ include::{generated}/api/version-notes/CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT.asciidoc[]
10948+ | {cl_mem_device_address_EXT_TYPE}[]
10949+ | Device pointers must reference locations contained entirely within
10950+ buffers that are passed to kernel as arguments, or that are passed
10951+ through the execution information. Non-argument device pointers accessed
10952+ by the kernel must be specified by passing pointers to those buffers
10953+ via this {clSetKernelExecInfo} option.
10954+ endif::cl_ext_buffer_device_address[]
10955+
1084710956|====
1084810957
1084910958// refError
@@ -10853,7 +10962,16 @@ successfully.
1085310962Otherwise, it returns one of the following errors:
1085410963
1085510964 * {CL_INVALID_KERNEL} if _kernel_ is a not a valid kernel object.
10856- * {CL_INVALID_OPERATION} if no devices in the context associated with _kernel_ support SVM.
10965+ * {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_SVM_PTRS} and
10966+ {CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM} if no devices in
10967+ the context associated with _kernel_ support SVM.
10968+ ifdef::cl_ext_buffer_device_address[]
10969+ * {CL_INVALID_OPERATION} for {CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT} if no
10970+ device in the context associated with _kernel_ support the {cl_ext_buffer_device_address_EXT}
10971+ extension.
10972+ endif::cl_ext_buffer_device_address[]
10973+ * {CL_INVALID_VALUE} if _param_name_ is not valid, if _param_value_ is
10974+ `NULL` or if the size specified by _param_value_size_ is not valid.
1085710975 * {CL_INVALID_OPERATION} if _param_name_ is
1085810976 {CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM} and _param_value_ is {CL_TRUE}
1085910977 and no devices in the context associated with _kernel_ support fine-grain
0 commit comments