Class INTELUnifiedSharedMemory
- java.lang.Object
-
- org.lwjgl.opencl.INTELUnifiedSharedMemory
-
public class INTELUnifiedSharedMemory extends java.lang.ObjectNative bindings to the intel_unified_shared_memory extension.This extension adds "Unified Shared Memory" (USM) to OpenCL. Unified Shared Memory provides:
- Easier integration into existing code bases by representing OpenCL allocations as pointers rather than handles (`cl_mems`), with full support for pointer arithmetic into allocations.
- Fine-grain control over ownership and accessibility of OpenCL allocations, to optimally choose between performance and programmer convenience.
- A simpler programming model, by automatically migrating some allocations between OpenCL devices and the host.
While Unified Shared Memory (USM) shares many features with Shared Virtual Memory (SVM), Unified Shared Memory provides a different mix of capabilities and control. Specifically:
- The matrix of USM capabilities supports combinations of features beyond the SVM capability queries.
- USM provides explicit control over memory placement and migration by supporting host allocations with wide visibility, devices allocations for best performance, and shared allocations that may migrate between devices and the host.
- USM allocations may be associated with both a device and a context. The USM allocation APIs support additional memory flags and optional properties to affect how memory is allocated and migrated.
- There is no need for APIs to map or unmap USM allocations, because host accessible USM allocations do not need to be mapped or unmapped to access the contents of a USM allocation on the host.
- An application may indicate that a kernel may access categories of USM allocations indirectly, without passing a set of all indirectly accessed USM allocations to the kernel, improving usability and reducing driver overhead for kernels that access many USM allocations.
- USM adds API functions to query properties of a USM allocation and to provide memory advice for an allocation.
Unified Shared Memory and Shared Virtual Memory can and will coexist for many implementations. All implementations that support Shared Virtual Memory may support at least some types of Unified Shared Memory.
Requires
CL20.
-
-
Field Summary
Fields Modifier and Type Field Description static intCL_COMMAND_MEMADVISE_INTEL
CL_COMMAND_MEMCPY_INTEL
CL_COMMAND_MEMFILL_INTEL
CL_COMMAND_MIGRATEMEM_INTELstatic intCL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL
CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL
CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL
CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL
CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTELAccepted value for theparam_nameparameter toGetDeviceInfoto query the Unified Shared Memory capabilities of an OpenCL device.static intCL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL
CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL
CL_KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTELAccepted value for theparam_nameparameter toSetKernelExecInfoto specify that the kernel may indirectly access Unified Shared Memory allocations of the specified type.static intCL_KERNEL_EXEC_INFO_USM_PTRS_INTELAccepted value for theparam_nameparameter toSetKernelExecInfoto specify a set of Unified Shared Memory allocations that the kernel may indirectly access.static intCL_MEM_ALLOC_BASE_PTR_INTEL
CL_MEM_ALLOC_DEVICE_INTELEnumeration type and values for theparam_nameparameter toGetMemAllocInfoINTELto query information about a Unified Shared Memory allocation.static intCL_MEM_ALLOC_FLAGS_INTELEnumerant value requesting optional allocation properties for a Unified Shared Memory allocation.static intCL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL
CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTELBitfield type and bits describing optional allocation properties for a Unified Shared Memory allocation.static intCL_MEM_ALLOC_SIZE_INTEL
CL_MEM_ALLOC_TYPE_INTELEnumeration type and values for theparam_nameparameter toGetMemAllocInfoINTELto query information about a Unified Shared Memory allocation.static intCL_MEM_ALLOC_WRITE_COMBINED_INTELBitfield type and bits describing optional allocation properties for a Unified Shared Memory allocation.static intCL_MEM_TYPE_DEVICE_INTEL
CL_MEM_TYPE_HOST_INTEL
CL_MEM_TYPE_SHARED_INTEL
CL_MEM_TYPE_UNKNOWN_INTELEnumeration type and values describing the type of Unified Shared Memory allocation.static intCL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL
CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL
CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL
CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTELBitfield type and bits describing the Unified Shared Memory capabilities of an OpenCL device.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.nio.ByteBufferclDeviceMemAllocINTEL(long context, long device, long[] properties, long size, int alignment, int[] errcode_ret)Array version of:DeviceMemAllocINTELstatic java.nio.ByteBufferclDeviceMemAllocINTEL(long context, long device, java.nio.LongBuffer properties, long size, int alignment, java.nio.IntBuffer errcode_ret)Allocates Unified Shared Memory specific to an OpenCL device.static intclEnqueueMemAdviseINTEL(long command_queue, java.nio.ByteBuffer ptr, long advice, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)Provides advice about a region of a shared Unified Shared Memory allocation.static intclEnqueueMemcpyINTEL(long command_queue, boolean blocking, java.nio.ByteBuffer dst_ptr, java.nio.ByteBuffer src_ptr, long size, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)Copies a region of memory from one location to another.static intclEnqueueMemFillINTEL(long command_queue, java.nio.ByteBuffer dst_ptr, java.nio.ByteBuffer pattern, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)Fills a region of a memory with the specified pattern.static intclEnqueueMigrateMemINTEL(long command_queue, java.nio.ByteBuffer ptr, long flags, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)Explicitly migrates a region of a shared Unified Shared Memory allocation to the device associated withcommand_queue.static intclGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, int[] param_value, org.lwjgl.PointerBuffer param_value_size_ret)Array version of:GetMemAllocInfoINTELstatic intclGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, java.nio.ByteBuffer param_value, org.lwjgl.PointerBuffer param_value_size_ret)Queries information about a Unified Shared Memory allocation.static intclGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, java.nio.IntBuffer param_value, org.lwjgl.PointerBuffer param_value_size_ret)Queries information about a Unified Shared Memory allocation.static intclGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, org.lwjgl.PointerBuffer param_value, org.lwjgl.PointerBuffer param_value_size_ret)Queries information about a Unified Shared Memory allocation.static java.nio.ByteBufferclHostMemAllocINTEL(long context, long[] properties, long size, int alignment, int[] errcode_ret)Array version of:HostMemAllocINTELstatic java.nio.ByteBufferclHostMemAllocINTEL(long context, java.nio.LongBuffer properties, long size, int alignment, java.nio.IntBuffer errcode_ret)Allocates host Unified Shared Memory.static intclMemBlockingFreeINTEL(long context, java.nio.ByteBuffer ptr)Frees a Unified Shared Memory allocation.static intclMemFreeINTEL(long context, java.nio.ByteBuffer ptr)Frees a Unified Shared Memory allocation.static intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, double[] arg_value)Array version of:SetKernelArgMemPointerINTELstatic intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, float[] arg_value)Array version of:SetKernelArgMemPointerINTELstatic intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, int[] arg_value)Array version of:SetKernelArgMemPointerINTELstatic intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, long[] arg_value)Array version of:SetKernelArgMemPointerINTELstatic intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, short[] arg_value)Array version of:SetKernelArgMemPointerINTELstatic intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.ByteBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.static intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.DoubleBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.static intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.FloatBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.static intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.IntBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.static intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.LongBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.static intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.ShortBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.static intclSetKernelArgMemPointerINTEL(long kernel, int arg_index, org.lwjgl.PointerBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.static java.nio.ByteBufferclSharedMemAllocINTEL(long context, long device, long[] properties, long size, int alignment, int[] errcode_ret)Array version of:SharedMemAllocINTELstatic java.nio.ByteBufferclSharedMemAllocINTEL(long context, long device, java.nio.LongBuffer properties, long size, int alignment, java.nio.IntBuffer errcode_ret)Allocates Unified Shared Memory with shared ownership between the host and the specified OpenCL device.static longnclDeviceMemAllocINTEL(long context, long device, long properties, long size, int alignment, long errcode_ret)Unsafe version of:DeviceMemAllocINTELstatic intnclEnqueueMemAdviseINTEL(long command_queue, long ptr, long size, long advice, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMemAdviseINTELstatic intnclEnqueueMemcpyINTEL(long command_queue, int blocking, long dst_ptr, long src_ptr, long size, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMemcpyINTELstatic intnclEnqueueMemFillINTEL(long command_queue, long dst_ptr, long pattern, long pattern_size, long size, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMemFillINTELstatic intnclEnqueueMigrateMemINTEL(long command_queue, long ptr, long size, long flags, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMigrateMemINTELstatic intnclGetMemAllocInfoINTEL(long context, long ptr, int param_name, long param_value_size, long param_value, long param_value_size_ret)Unsafe version of:GetMemAllocInfoINTELstatic longnclHostMemAllocINTEL(long context, long properties, long size, int alignment, long errcode_ret)Unsafe version of:HostMemAllocINTELstatic intnclMemBlockingFreeINTEL(long context, long ptr)Unsafe version of:MemBlockingFreeINTELstatic intnclMemFreeINTEL(long context, long ptr)Unsafe version of:MemFreeINTELstatic intnclSetKernelArgMemPointerINTEL(long kernel, int arg_index, long arg_value)Unsafe version of:SetKernelArgMemPointerINTELstatic longnclSharedMemAllocINTEL(long context, long device, long properties, long size, int alignment, long errcode_ret)Unsafe version of:SharedMemAllocINTEL
-
-
-
Field Detail
-
CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL, CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL, CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL, CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL
Accepted value for theparam_nameparameter toGetDeviceInfoto query the Unified Shared Memory capabilities of an OpenCL device.
-
CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL, CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL, CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL, CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTEL
Bitfield type and bits describing the Unified Shared Memory capabilities of an OpenCL device. (cl_device_unified_shared_memory_capabilities_intel)
-
CL_MEM_ALLOC_FLAGS_INTEL
Enumerant value requesting optional allocation properties for a Unified Shared Memory allocation.
-
CL_MEM_ALLOC_WRITE_COMBINED_INTEL, CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL, CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL
Bitfield type and bits describing optional allocation properties for a Unified Shared Memory allocation. (cl_mem_alloc_flags_intel)Enum values:
MEM_ALLOC_WRITE_COMBINED_INTEL- Request write combined (WC) memory.Write combined memory may improve performance in some cases, however write combined memory must be used with care since it may hurt performance in other cases or use different coherency protocols than non-write combined memory.
MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL- Request the implementation to optimize for first access being done by the device.This flag is valid only for
SharedMemAllocINTEL. This flag does not affect functionality and is purely a performance hint.MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL- Request the implementation to optimize for first access being done by the host.This flag is valid only for
SharedMemAllocINTEL. This flag does not affect functionality and is purely a performance hint.CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTELandCL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTELare mutually exclusive.
-
CL_MEM_ALLOC_TYPE_INTEL, CL_MEM_ALLOC_BASE_PTR_INTEL, CL_MEM_ALLOC_SIZE_INTEL, CL_MEM_ALLOC_DEVICE_INTEL
Enumeration type and values for theparam_nameparameter toGetMemAllocInfoINTELto query information about a Unified Shared Memory allocation. (cl_mem_info_intel)Optional allocation properties may also be queried using
clGetMemAllocInfoINTEL.
-
CL_MEM_TYPE_UNKNOWN_INTEL, CL_MEM_TYPE_HOST_INTEL, CL_MEM_TYPE_DEVICE_INTEL, CL_MEM_TYPE_SHARED_INTEL
Enumeration type and values describing the type of Unified Shared Memory allocation. Returned byGetMemAllocInfoINTELwhenparam_nameisMEM_ALLOC_TYPE_INTEL. (cl_unified_shared_memory_type_intel)
-
CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL, CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL, CL_KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTEL
Accepted value for theparam_nameparameter toSetKernelExecInfoto specify that the kernel may indirectly access Unified Shared Memory allocations of the specified type.
-
CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL
Accepted value for theparam_nameparameter toSetKernelExecInfoto specify a set of Unified Shared Memory allocations that the kernel may indirectly access.
-
-
Method Detail
-
nclHostMemAllocINTEL
public static long nclHostMemAllocINTEL(long context, long properties, long size, int alignment, long errcode_ret)Unsafe version of:HostMemAllocINTEL
-
clHostMemAllocINTEL
@Nullable public static java.nio.ByteBuffer clHostMemAllocINTEL(long context, @Nullable java.nio.LongBuffer properties, long size, int alignment, @Nullable java.nio.IntBuffer errcode_ret)Allocates host Unified Shared Memory.- Parameters:
context- a valid OpenCL context used to allocate the host memoryproperties- an optional list of allocation properties and their corresponding values.The list is terminated with the special property
0. If no allocation properties are required,propertiesmay beNULL.size- the size in bytes of the requested host allocationalignment- the minimum alignment in bytes for the requested host allocation.It must be a power of two and must be equal to or smaller than the size of the largest data type supported by any OpenCL device in
context. Ifalignmentis0, a default alignment will be used that is equal to the size of the largest data type supported by any OpenCL device incontext.errcode_ret- will return an appropriate error code. Iferrcode_retisNULL, no error code is returned.- Returns:
- a valid non-
NULLaddress andSUCCESSwill be returned inerrcode_retif the host Unified Shared Memory is allocated successfully. Otherwise,NULLwill be returned, anderrcode_retwill be set to one of the following error values:INVALID_CONTEXTifcontextis not a valid context.INVALID_OPERATIONifDEVICE_HOST_MEM_CAPABILITIES_INTELis zero for all devices incontext, indicating that no devices incontextsupport host Unified Shared Memory allocations.INVALID_VALUEifalignmentis not zero or a power of two.INVALID_VALUEifalignmentis greater than the size of the largest data type supported by any OpenCL device incontextthat supports host Unified Shared Memory allocations.INVALID_PROPERTYif a memory property name inpropertiesis not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.INVALID_PROPERTYif either theMEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTELorMEM_ALLOC_INITIAL_PLACEMENT_HOST_INTELflags are specified.INVALID_BUFFER_SIZEifsizeis zero or greater thanDEVICE_MAX_MEM_ALLOC_SIZEfor any OpenCL device incontextthat supports host Unified Shared Memory allocations.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclDeviceMemAllocINTEL
public static long nclDeviceMemAllocINTEL(long context, long device, long properties, long size, int alignment, long errcode_ret)Unsafe version of:DeviceMemAllocINTEL
-
clDeviceMemAllocINTEL
@Nullable public static java.nio.ByteBuffer clDeviceMemAllocINTEL(long context, long device, @Nullable java.nio.LongBuffer properties, long size, int alignment, @Nullable java.nio.IntBuffer errcode_ret)Allocates Unified Shared Memory specific to an OpenCL device.- Parameters:
context- a valid OpenCL context used to allocate the device memorydevice- a valid OpenCL device ID to associate with the allocationproperties- an optional list of allocation properties and their corresponding values.The list is terminated with the special property
0. If no allocation properties are required,propertiesmay beNULL.size- the size in bytes of the requested device allocationalignment- the minimum alignment in bytes for the requested device allocation.It must be a power of two and must be equal to or smaller than the size of the largest data type supported by
device. Ifalignmentis0, a default alignment will be used that is equal to the size of largest data type supported bydevice.errcode_ret- will return an appropriate error code. Iferrcode_retisNULL, no error code is returned.- Returns:
- a valid non-
NULLaddress andSUCCESSwill be returned inerrcode_retif the device Unified Shared Memory is allocated successfully. Otherwise,NULLwill be returned, anderrcode_retwill be set to one of the following error values:INVALID_CONTEXTifcontextis not a valid context.INVALID_DEVICEifdeviceis not a valid device or is not associated withcontext.INVALID_OPERATION` ifDEVICE_DEVICE_MEM_CAPABILITIES_INTELis zero fordevice, indicating thatdevicedoes not support device Unified Shared Memory allocations.INVALID_VALUEifalignmentis not zero or a power of two.INVALID_VALUEifalignmentis greater than the size of the largest data type supported bydevice.INVALID_PROPERTYif a memory property name inpropertiesis not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.INVALID_PROPERTYif either theMEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTELorMEM_ALLOC_INITIAL_PLACEMENT_HOST_INTELflags are specified.INVALID_BUFFER_SIZEifsizeis zero or greater thanDEVICE_MAX_MEM_ALLOC_SIZEfordevice.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclSharedMemAllocINTEL
public static long nclSharedMemAllocINTEL(long context, long device, long properties, long size, int alignment, long errcode_ret)Unsafe version of:SharedMemAllocINTEL
-
clSharedMemAllocINTEL
@Nullable public static java.nio.ByteBuffer clSharedMemAllocINTEL(long context, long device, @Nullable java.nio.LongBuffer properties, long size, int alignment, @Nullable java.nio.IntBuffer errcode_ret)Allocates Unified Shared Memory with shared ownership between the host and the specified OpenCL device.If the specified OpenCL device supports cross-device access capabilities, the allocation is also accessible by other OpenCL devices in the context that have cross-device access capabilities.
- Parameters:
context- a valid OpenCL context used to allocate the Unified Shared Memorydevice- an optional OpenCL device ID to associate with the allocation.If
device isNULLthen the allocation is not associated with any device. Allocations with no associated device are accessible by the host and OpenCL devices in the context that have cross-device access capabilities.properties- an optional list of allocation properties and their corresponding values.The list is terminated with the special property
0. If no allocation properties are required,propertiesmay beNULL.size- the size in bytes of the requested device allocationalignment- the minimum alignment in bytes for the requested shared allocation.It must be a power of two and must be equal to or smaller than the size of the largest data type supported by
device. Ifalignmentis0, a default alignment will be used that is equal to the size of largest data type supported bydevice. IfdeviceisNULL,alignmentmust be a power of two equal to or smaller than the size of the largest data type supported by any OpenCL device incontext, and the default alignment will be equal to the size of the largest data type supported by any OpenCL device incontext.errcode_ret- will return an appropriate error code. Iferrcode_retisNULL, no error code is returned.- Returns:
- a valid non-
NULLaddress andSUCCESSwill be returned inerrcode_retif the shared Unified Shared Memory is allocated successfully. Otherwise,NULLwill be returned, anderrcode_retwill be set to one of the following error values:INVALID_CONTEXTifcontextis not a valid context.INVALID_DEVICEifdeviceis notNULLand is either not a valid device or is not associated withcontext.INVALID_OPERATIONifdeviceis notNULLandDEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTELandDEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTELare both zero, indicating thatdevicedoes not support shared Unified Shared Memory allocations, or ifdeviceisNULLand no devices incontextsupport shared Unified Shared Memory allocations.INVALID_VALUEifalignmentis not zero or a power of two.INVALID_VALUEifdeviceis notNULLandalignmentis greater than the size of the largest data type supported bydevice, or ifdeviceisNULLandalignmentis greater than the size of the largest data type supported by any OpenCL device incontextthat supports shared Unified Shared Memory allocations.INVALID_PROPERTYif a memory property name inpropertiesis not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.INVALID_PROPERTYif bothMEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTELandMEM_ALLOC_INITIAL_PLACEMENT_HOST_INTELflags are specified.INVALID_BUFFER_SIZEifsizeis zero, or ifdeviceis notNULLandsizeis greater thanDEVICE_MAX_MEM_ALLOC_SIZEfordevice, or ifdeviceisNULLandsizeis greater thanDEVICE_MAX_MEM_ALLOC_SIZEfor any device incontextthat supports shared Unified Shared Memory allocations.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclMemFreeINTEL
public static int nclMemFreeINTEL(long context, long ptr)Unsafe version of:MemFreeINTEL
-
clMemFreeINTEL
public static int clMemFreeINTEL(long context, @Nullable java.nio.ByteBuffer ptr)Frees a Unified Shared Memory allocation.Note that
clMemFreeINTELmay not wait for previously enqueued commands that may be usingptrto finish before freeingptr. It is the responsibility of the application to make sure enqueued commands that useptrare complete before freeingptr. Applications should take particular care freeing memory allocations with kernels that may access memory indirectly, since a kernel with indirect memory access counts as using all memory allocations of the specified type or types.To wait for previously enqueued commands to finish that may be using
ptrbefore freeingptr, use theMemBlockingFreeINTELfunction instead.- Parameters:
context- a valid OpenCL context used to free the Unified Shared Memory allocationptr- the Unified Shared Memory allocation to free.It must be a value returned by
HostMemAllocINTEL,DeviceMemAllocINTEL, orSharedMemAllocINTEL, or aNULLpointer. IfptrisNULLthen no action occurs.- Returns:
SUCCESSif the function executes successfully. Otherwise, they will return one of the following error values:INVALID_CONTEXTifcontextis not a valid context.INVALID_VALUEifptris not a value returned byHostMemAllocINTEL,DeviceMemAllocINTEL,SharedMemAllocINTEL, or aNULLpointer.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclMemBlockingFreeINTEL
public static int nclMemBlockingFreeINTEL(long context, long ptr)Unsafe version of:MemBlockingFreeINTEL
-
clMemBlockingFreeINTEL
public static int clMemBlockingFreeINTEL(long context, @Nullable java.nio.ByteBuffer ptr)Frees a Unified Shared Memory allocation.- Parameters:
context- a valid OpenCL context used to free the Unified Shared Memory allocationptr- the Unified Shared Memory allocation to free.It must be a value returned by
HostMemAllocINTEL,DeviceMemAllocINTEL, orSharedMemAllocINTEL, or aNULLpointer. IfptrisNULLthen no action occurs.- Returns:
SUCCESSif the function executes successfully. Otherwise, they will return one of the following error values:INVALID_CONTEXTifcontextis not a valid context.INVALID_VALUEifptris not a value returned byHostMemAllocINTEL,DeviceMemAllocINTEL,SharedMemAllocINTEL, or aNULLpointer.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclGetMemAllocInfoINTEL
public static int nclGetMemAllocInfoINTEL(long context, long ptr, int param_name, long param_value_size, long param_value, long param_value_size_ret)Unsafe version of:GetMemAllocInfoINTEL- Parameters:
param_value_size- the size in bytes of memory pointed to byparam_value. This size must be ≥ size of return type. Ifparam_valueisNULL, it is ignored.
-
clGetMemAllocInfoINTEL
public static int clGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, @Nullable java.nio.ByteBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) public static int clGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, @Nullable java.nio.IntBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) public static int clGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, @Nullable org.lwjgl.PointerBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret)Queries information about a Unified Shared Memory allocation.- Parameters:
context- a valid OpenCL context to query for information about the Unified Shared Memory allocationptr- a pointer into a Unified Shared Memory allocation to query.ptr need not be a valuereturned byHostMemAllocINTEL,DeviceMemAllocINTEL, orSharedMemAllocINTEL, but the query may be faster if it is.param_name- the information to query. One of:MEM_ALLOC_TYPE_INTELMEM_ALLOC_BASE_PTR_INTELMEM_ALLOC_SIZE_INTELMEM_ALLOC_DEVICE_INTELparam_value- a pointer to memory where the appropriate result being queried is returned.If
param_valueisNULL, it is ignored.param_value_size_ret- the actual size in bytes of data being queried byparam_value. IfNULL, it is ignored.- Returns:
SUCCESSif the function is executed successfully. Otherwise, it will return one of the following error values:INVALID_CONTEXTifcontextis not a valid context.INVALID_VALUEifparam_nameis not a valid Unified Shared Memory allocation query.INVALID_VALUE` ifparam_valueis notNULLandparam_value_sizeis smaller than the size of the query return type.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclSetKernelArgMemPointerINTEL
public static int nclSetKernelArgMemPointerINTEL(long kernel, int arg_index, long arg_value)Unsafe version of:SetKernelArgMemPointerINTEL
-
clSetKernelArgMemPointerINTEL
public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.ByteBuffer arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.ShortBuffer arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.IntBuffer arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.LongBuffer arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.FloatBuffer arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, java.nio.DoubleBuffer arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, org.lwjgl.PointerBuffer arg_value)Sets a pointer into a Unified Shared Memory allocation as an argument to a kernel.- Parameters:
kernel- a valid kernel objectarg_index- the argument index to set.Arguments to the kernel are referred to by indices that go from 0 for the leftmost argument to
n - 1, wherenis the total number of arguments declared by a kernel.arg_value- the pointer value that should be used as the argument specified byarg_index.The pointer value will be used as the argument by all API calls that enqueue a kernel until the argument value is set to a different pointer value by a subsequent call. A pointer into Unified Shared Memory allocation may only be set as an argument value for an argument declared to be a pointer to
globalorconstantmemory. For devices supporting shared system allocations, any pointer value is valid. Otherwise, the pointer value must beNULLor must point into a Unified Shared Memory allocation returned byHostMemAllocINTEL,DeviceMemAllocINTEL, orSharedMemAllocINTEL.- Returns:
SUCCESSif the function is executed successfully. Otherwise, it will return one of the following errors:INVALID_KERNELifkernelis not a valid kernel object.INVALID_ARG_INDEXifarg_indexis not a valid argument index.INVALID_ARG_VALUEifarg_valueis not a valid argument value.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclEnqueueMemFillINTEL
public static int nclEnqueueMemFillINTEL(long command_queue, long dst_ptr, long pattern, long pattern_size, long size, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMemFillINTEL- Parameters:
pattern_size- the size of of the value to write to the Unified Shared Memory region, in bytes.Must be a power of two and must be less than or equal to the size of the largest integer or floating-point vector data type supported by the device.
size- the size of the memory region to set, in bytesnum_events_in_wait_list- the number of events inevent_wait_list
-
clEnqueueMemFillINTEL
public static int clEnqueueMemFillINTEL(long command_queue, java.nio.ByteBuffer dst_ptr, java.nio.ByteBuffer pattern, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event)Fills a region of a memory with the specified pattern.- Parameters:
command_queue- a valid host command queue.The memory fill command will be queued for execution on the device associated with
command_queue.dst_ptr- a pointer to the start of the memory region to fill.The Unified Shared Memory allocation pointed to by
dst_ptrmust be valid for the context associated withcommand_queue, must be accessible by the device associated withcommand_queue, and must be aligned topattern_sizebytes.pattern- a pointer to the value to write to the Unified Shared Memory region.The memory associated with
patterncan be reused or freed after the function returns.event_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust be the same.event- Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.eventcan beNULLin which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.- Returns:
SUCCESSif the command is queued successfully. Otherwise, it will return one of the following errors:INVALID_COMMAND_QUEUEifcommand_queueis not a valid host command-queue.INVALID_CONTEXTif the context associated withcommand_queueand events inevent_wait_listare not the same.INVALID_VALUEifdst_ptrisNULL, or ifdst_ptris not aligned topattern_sizebytes.INVALID_VALUEifpatternisNULL.INVALID_VALUEifpattern_sizeis not a power of two or is greater than the size of the largest integer or floating-point vector data type supported by the device associated withcommand_queue.INVALID_VALUEifsizeis not a multiple ofpattern_size.INVALID_EVENT_WAIT_LISTifevent_wait_listisNULLandnum_events_in_wait_listis greater than zero, or ifevent_wait_listis notNULLandnum_events_in_wait_listis zero, or if event objects inevent_wait_listare not valid events.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclEnqueueMemcpyINTEL
public static int nclEnqueueMemcpyINTEL(long command_queue, int blocking, long dst_ptr, long src_ptr, long size, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMemcpyINTEL- Parameters:
num_events_in_wait_list- the number of events inevent_wait_list
-
clEnqueueMemcpyINTEL
public static int clEnqueueMemcpyINTEL(long command_queue, boolean blocking, java.nio.ByteBuffer dst_ptr, java.nio.ByteBuffer src_ptr, long size, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event)Copies a region of memory from one location to another.- Parameters:
command_queue- a valid host command queue.The memory copy command will be queued for execution on the device associated with
command_queue.blocking- indicates if the copy operation is blocking or non-blocking.If
blocking isTRUE, the copy command is blocking, and the function will not return until the copy command is complete. Otherwise, ifblockingisFALSE, the copy command is non-blocking, and the contents of thedst_ptrcannot be used nor can the contents of thesrc_ptrbe overwritten until the copy command is complete.dst_ptr- a pointer to the start of the memory region to copy to.If
dst_ptris a pointer into a Unified Shared Memory allocation it must be valid for the context associated withcommand_queue.src_ptr- a pointer to the start of the memory region to copy from.If
src_ptr isa pointer into a Unified Shared Memory allocation it must be valid for the context associated withcommand_queue.size- the size of the memory region to copy, in bytesevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust be the same.event- Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.eventcan beNULLin which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.- Returns:
SUCCESSif the command is queued successfully. Otherwise, it will return one of the following errors:INVALID_COMMAND_QUEUEifcommand_queueis not a valid host command-queue.INVALID_CONTEXTif the context associated withcommand_queueand events inevent_wait_listare not the same.INVALID_VALUEif eitherdst_ptrorsrc_ptrareNULL.INVALID_EVENT_WAIT_LISTifevent_wait_listisNULLandnum_events_in_wait_listis greater than zero, or ifevent_wait_listis notNULLandnum_events_in_wait_listis zero, or if event objects inevent_wait_listare not valid events.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LISTif the copy operation is blocking and the execution status of any of the events inevent_wait_listis a negative integer value.MEM_COPY_OVERLAPif the values specified fordst_ptr,src_ptrandsizeresult in an overlapping copy.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclEnqueueMigrateMemINTEL
public static int nclEnqueueMigrateMemINTEL(long command_queue, long ptr, long size, long flags, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMigrateMemINTEL- Parameters:
size- the size of the memory region to migratenum_events_in_wait_list- the number of events inevent_wait_list
-
clEnqueueMigrateMemINTEL
public static int clEnqueueMigrateMemINTEL(long command_queue, java.nio.ByteBuffer ptr, long flags, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event)Explicitly migrates a region of a shared Unified Shared Memory allocation to the device associated withcommand_queue.This is a hint that may improve performance and is not required for correctness. Memory migration may not be supported for all allocation types for all devices. If memory migration is not supported for the specified memory range then the migration hint may be ignored. Memory migration may only be supported at a device-specific granularity, such as a page boundary. In this case, the memory range may be expanded such that the start and end of the range satisfy the granularity requirements.
- Parameters:
command_queue- a valid host command queue.The memory migration command will be queued for execution on the device associated with
command_queue.ptr- a pointer to the start of the shared Unified Shared Memory allocation to migrateflags- a bit-field that is used to specify memory migration optionsevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust be the same.event- Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.eventcan beNULLin which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.- Returns:
SUCCESSif the command is queued successfully. Otherwise, it will return one of the following errors:INVALID_COMMAND_QUEUEifcommand_queueis not a valid host command-queue.INVALID_CONTEXTif the context associated withcommand_queueand events inevent_wait_listare not the same.INVALID_VALUEifflagsis zero or is not a supported combination of memory migration flags.INVALID_EVENT_WAIT_LISTifevent_wait_listisNULLandnum_events_in_wait_listis greater than zero, or ifevent_wait_listis notNULLandnum_events_in_wait_listis zero, or if event objects inevent_wait_listare not valid events.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
nclEnqueueMemAdviseINTEL
public static int nclEnqueueMemAdviseINTEL(long command_queue, long ptr, long size, long advice, int num_events_in_wait_list, long event_wait_list, long event)Unsafe version of:EnqueueMemAdviseINTEL- Parameters:
size- the size of the memory regionnum_events_in_wait_list- the number of events inevent_wait_list
-
clEnqueueMemAdviseINTEL
public static int clEnqueueMemAdviseINTEL(long command_queue, java.nio.ByteBuffer ptr, long advice, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event)Provides advice about a region of a shared Unified Shared Memory allocation.Memory advice is a performance hint only and is not required for correctness. Providing memory advice hints may override driver heuristics that control shared memory behavior. Not all memory advice hints may be supported for all allocation types for all devices. If a memory advice hint is not supported by the device it will be ignored. Memory advice hints may only be supported at a device-specific granularity, such as at a page boundary. In this case, the memory range may be expanded such that the start and end of the range satisfy the granularity requirements.
- Parameters:
command_queue- a valid host command queue.The memory advice hints will be queued for the device associated with
command_queue.ptr- a pointer to the start of the shared Unified Shared Memory allocationadvice- a bit-field describing the memory advice hints for the regionevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust be the same.event- Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.eventcan beNULLin which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.- Returns:
SUCCESSif the command is queued successfully. Otherwise, it will return one of the following errors:INVALID_COMMAND_QUEUEifcommand_queueis not a valid host command-queue.INVALID_CONTEXTif the context associated withcommand_queueand events inevent_wait_listare not the same.INVALID_VALUEifadviceis not supported advice for the device associated withcommand_queue.INVALID_EVENT_WAIT_LISTifevent_wait_listisNULLandnum_events_in_wait_listis greater than zero, or ifevent_wait_listis notNULLandnum_events_in_wait_listis zero, or if event objects inevent_wait_listare not valid events.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
clHostMemAllocINTEL
@Nullable public static java.nio.ByteBuffer clHostMemAllocINTEL(long context, @Nullable long[] properties, long size, int alignment, @Nullable int[] errcode_ret)Array version of:HostMemAllocINTEL
-
clDeviceMemAllocINTEL
@Nullable public static java.nio.ByteBuffer clDeviceMemAllocINTEL(long context, long device, @Nullable long[] properties, long size, int alignment, @Nullable int[] errcode_ret)Array version of:DeviceMemAllocINTEL
-
clSharedMemAllocINTEL
@Nullable public static java.nio.ByteBuffer clSharedMemAllocINTEL(long context, long device, @Nullable long[] properties, long size, int alignment, @Nullable int[] errcode_ret)Array version of:SharedMemAllocINTEL
-
clGetMemAllocInfoINTEL
public static int clGetMemAllocInfoINTEL(long context, java.nio.ByteBuffer ptr, int param_name, @Nullable int[] param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret)Array version of:GetMemAllocInfoINTEL
-
clSetKernelArgMemPointerINTEL
public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, short[] arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, int[] arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, long[] arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, float[] arg_value) public static int clSetKernelArgMemPointerINTEL(long kernel, int arg_index, double[] arg_value)Array version of:SetKernelArgMemPointerINTEL
-
-