Class CL11
- Direct Known Subclasses:
CL12
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
cl_addressing_mode.static final int
cl_buffer_create_type.static final int
cl_command_type.static final int
cl_command_type.static final int
cl_command_type.static final int
cl_command_type.static final int
cl_context_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_device_info.static final int
cl_event_info.static final int
Error Codes.static final int
cl_device_fp_config - bitfield.static final int
Error Codes.static final int
cl_kernel_work_group_info.static final int
cl_kernel_work_group_info.static final int
cl_mem_info.static final int
cl_mem_info.static final int
Error Codes.static final int
cl_channel_order.static final int
cl_channel_order.static final int
cl_channel_order.static final int
OpenCL Version.Fields inherited from class org.lwjgl.opencl.CL10
CL_A, CL_ADDRESS_CLAMP, CL_ADDRESS_CLAMP_TO_EDGE, CL_ADDRESS_NONE, CL_ADDRESS_REPEAT, CL_ARGB, CL_BGRA, CL_BUILD_ERROR, CL_BUILD_IN_PROGRESS, CL_BUILD_NONE, CL_BUILD_PROGRAM_FAILURE, CL_BUILD_SUCCESS, CL_COMMAND_ACQUIRE_GL_OBJECTS, CL_COMMAND_COPY_BUFFER, CL_COMMAND_COPY_BUFFER_TO_IMAGE, CL_COMMAND_COPY_IMAGE, CL_COMMAND_COPY_IMAGE_TO_BUFFER, CL_COMMAND_MAP_BUFFER, CL_COMMAND_MAP_IMAGE, CL_COMMAND_MARKER, CL_COMMAND_NATIVE_KERNEL, CL_COMMAND_NDRANGE_KERNEL, CL_COMMAND_READ_BUFFER, CL_COMMAND_READ_IMAGE, CL_COMMAND_RELEASE_GL_OBJECTS, CL_COMMAND_TASK, CL_COMMAND_UNMAP_MEM_OBJECT, CL_COMMAND_WRITE_BUFFER, CL_COMMAND_WRITE_IMAGE, CL_COMPILER_NOT_AVAILABLE, CL_COMPLETE, CL_CONTEXT_DEVICES, CL_CONTEXT_PLATFORM, CL_CONTEXT_PROPERTIES, CL_CONTEXT_REFERENCE_COUNT, CL_DEVICE_ADDRESS_BITS, CL_DEVICE_AVAILABLE, CL_DEVICE_COMPILER_AVAILABLE, CL_DEVICE_ENDIAN_LITTLE, CL_DEVICE_ERROR_CORRECTION_SUPPORT, CL_DEVICE_EXECUTION_CAPABILITIES, CL_DEVICE_EXTENSIONS, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, CL_DEVICE_GLOBAL_MEM_SIZE, CL_DEVICE_IMAGE_SUPPORT, CL_DEVICE_IMAGE2D_MAX_HEIGHT, CL_DEVICE_IMAGE2D_MAX_WIDTH, CL_DEVICE_IMAGE3D_MAX_DEPTH, CL_DEVICE_IMAGE3D_MAX_HEIGHT, CL_DEVICE_IMAGE3D_MAX_WIDTH, CL_DEVICE_LOCAL_MEM_SIZE, CL_DEVICE_LOCAL_MEM_TYPE, CL_DEVICE_MAX_CLOCK_FREQUENCY, CL_DEVICE_MAX_COMPUTE_UNITS, CL_DEVICE_MAX_CONSTANT_ARGS, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, CL_DEVICE_MAX_MEM_ALLOC_SIZE, CL_DEVICE_MAX_PARAMETER_SIZE, CL_DEVICE_MAX_READ_IMAGE_ARGS, CL_DEVICE_MAX_SAMPLERS, CL_DEVICE_MAX_WORK_GROUP_SIZE, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, CL_DEVICE_MAX_WORK_ITEM_SIZES, CL_DEVICE_MAX_WRITE_IMAGE_ARGS, CL_DEVICE_MEM_BASE_ADDR_ALIGN, CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, CL_DEVICE_NAME, CL_DEVICE_NOT_AVAILABLE, CL_DEVICE_NOT_FOUND, CL_DEVICE_PLATFORM, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, CL_DEVICE_PROFILE, CL_DEVICE_PROFILING_TIMER_RESOLUTION, CL_DEVICE_QUEUE_PROPERTIES, CL_DEVICE_SINGLE_FP_CONFIG, CL_DEVICE_TYPE, CL_DEVICE_TYPE_ACCELERATOR, CL_DEVICE_TYPE_ALL, CL_DEVICE_TYPE_CPU, CL_DEVICE_TYPE_DEFAULT, CL_DEVICE_TYPE_GPU, CL_DEVICE_VENDOR, CL_DEVICE_VENDOR_ID, CL_DEVICE_VERSION, CL_DRIVER_VERSION, CL_EVENT_COMMAND_EXECUTION_STATUS, CL_EVENT_COMMAND_QUEUE, CL_EVENT_COMMAND_TYPE, CL_EVENT_REFERENCE_COUNT, CL_EXEC_KERNEL, CL_EXEC_NATIVE_KERNEL, CL_FALSE, CL_FILTER_LINEAR, CL_FILTER_NEAREST, CL_FLOAT, CL_FP_DENORM, CL_FP_FMA, CL_FP_INF_NAN, CL_FP_ROUND_TO_INF, CL_FP_ROUND_TO_NEAREST, CL_FP_ROUND_TO_ZERO, CL_GLOBAL, CL_HALF_FLOAT, CL_IMAGE_DEPTH, CL_IMAGE_ELEMENT_SIZE, CL_IMAGE_FORMAT, CL_IMAGE_FORMAT_MISMATCH, CL_IMAGE_FORMAT_NOT_SUPPORTED, CL_IMAGE_HEIGHT, CL_IMAGE_ROW_PITCH, CL_IMAGE_SLICE_PITCH, CL_IMAGE_WIDTH, CL_INTENSITY, CL_INVALID_ARG_INDEX, CL_INVALID_ARG_SIZE, CL_INVALID_ARG_VALUE, CL_INVALID_BINARY, CL_INVALID_BUFFER_SIZE, CL_INVALID_BUILD_OPTIONS, CL_INVALID_COMMAND_QUEUE, CL_INVALID_CONTEXT, CL_INVALID_DEVICE, CL_INVALID_DEVICE_TYPE, CL_INVALID_EVENT, CL_INVALID_EVENT_WAIT_LIST, CL_INVALID_GLOBAL_OFFSET, CL_INVALID_GLOBAL_WORK_SIZE, CL_INVALID_HOST_PTR, CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, CL_INVALID_IMAGE_SIZE, CL_INVALID_KERNEL, CL_INVALID_KERNEL_ARGS, CL_INVALID_KERNEL_DEFINITION, CL_INVALID_KERNEL_NAME, CL_INVALID_MEM_OBJECT, CL_INVALID_OPERATION, CL_INVALID_PLATFORM, CL_INVALID_PROGRAM, CL_INVALID_PROGRAM_EXECUTABLE, CL_INVALID_QUEUE_PROPERTIES, CL_INVALID_SAMPLER, CL_INVALID_VALUE, CL_INVALID_WORK_DIMENSION, CL_INVALID_WORK_GROUP_SIZE, CL_INVALID_WORK_ITEM_SIZE, CL_KERNEL_COMPILE_WORK_GROUP_SIZE, CL_KERNEL_CONTEXT, CL_KERNEL_FUNCTION_NAME, CL_KERNEL_LOCAL_MEM_SIZE, CL_KERNEL_NUM_ARGS, CL_KERNEL_PROGRAM, CL_KERNEL_REFERENCE_COUNT, CL_KERNEL_WORK_GROUP_SIZE, CL_LOCAL, CL_LUMINANCE, CL_MAP_FAILURE, CL_MAP_READ, CL_MAP_WRITE, CL_MEM_ALLOC_HOST_PTR, CL_MEM_CONTEXT, CL_MEM_COPY_HOST_PTR, CL_MEM_COPY_OVERLAP, CL_MEM_FLAGS, CL_MEM_HOST_PTR, CL_MEM_MAP_COUNT, CL_MEM_OBJECT_ALLOCATION_FAILURE, CL_MEM_OBJECT_BUFFER, CL_MEM_OBJECT_IMAGE2D, CL_MEM_OBJECT_IMAGE3D, CL_MEM_READ_ONLY, CL_MEM_READ_WRITE, CL_MEM_REFERENCE_COUNT, CL_MEM_SIZE, CL_MEM_TYPE, CL_MEM_USE_HOST_PTR, CL_MEM_WRITE_ONLY, CL_NONE, CL_OUT_OF_HOST_MEMORY, CL_OUT_OF_RESOURCES, CL_PLATFORM_EXTENSIONS, CL_PLATFORM_NAME, CL_PLATFORM_PROFILE, CL_PLATFORM_VENDOR, CL_PLATFORM_VERSION, CL_PROFILING_COMMAND_END, CL_PROFILING_COMMAND_QUEUED, CL_PROFILING_COMMAND_START, CL_PROFILING_COMMAND_SUBMIT, CL_PROFILING_INFO_NOT_AVAILABLE, CL_PROGRAM_BINARIES, CL_PROGRAM_BINARY_SIZES, CL_PROGRAM_BUILD_LOG, CL_PROGRAM_BUILD_OPTIONS, CL_PROGRAM_BUILD_STATUS, CL_PROGRAM_CONTEXT, CL_PROGRAM_DEVICES, CL_PROGRAM_NUM_DEVICES, CL_PROGRAM_REFERENCE_COUNT, CL_PROGRAM_SOURCE, CL_QUEUE_CONTEXT, CL_QUEUE_DEVICE, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, CL_QUEUE_PROFILING_ENABLE, CL_QUEUE_PROPERTIES, CL_QUEUE_REFERENCE_COUNT, CL_QUEUED, CL_R, CL_RA, CL_READ_ONLY_CACHE, CL_READ_WRITE_CACHE, CL_RG, CL_RGB, CL_RGBA, CL_RUNNING, CL_SAMPLER_ADDRESSING_MODE, CL_SAMPLER_CONTEXT, CL_SAMPLER_FILTER_MODE, CL_SAMPLER_NORMALIZED_COORDS, CL_SAMPLER_REFERENCE_COUNT, CL_SIGNED_INT16, CL_SIGNED_INT32, CL_SIGNED_INT8, CL_SNORM_INT16, CL_SNORM_INT8, CL_SUBMITTED, CL_SUCCESS, CL_TRUE, CL_UNORM_INT_101010, CL_UNORM_INT16, CL_UNORM_INT8, CL_UNORM_SHORT_555, CL_UNORM_SHORT_565, CL_UNSIGNED_INT16, CL_UNSIGNED_INT32, CL_UNSIGNED_INT8, CL_VERSION_1_0
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
clCreateSubBuffer
(long buffer, long flags, int buffer_create_type, ByteBuffer buffer_create_info, int[] errcode_ret) Array version of:CreateSubBuffer
static long
clCreateSubBuffer
(long buffer, long flags, int buffer_create_type, ByteBuffer buffer_create_info, IntBuffer errcode_ret) Creates a new buffer object (referred to as a sub-buffer object) from an existing buffer object.static long
clCreateUserEvent
(long context, int[] errcode_ret) Array version of:CreateUserEvent
static long
clCreateUserEvent
(long context, IntBuffer errcode_ret) Creates a user event object.static int
clEnqueueCopyBufferRect
(long command_queue, long src_buffer, long dst_buffer, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to copy a 2D or 3D rectangular region from the buffer object identified bysrc_buffer
to a 2D or 3D region in the buffer object identified bydst_buffer
.static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, double[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBufferRect
static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, float[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBufferRect
static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, int[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBufferRect
static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, short[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBufferRect
static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ByteBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, DoubleBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, FloatBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, IntBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.static int
clEnqueueReadBufferRect
(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ShortBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, double[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBufferRect
static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, float[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBufferRect
static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, int[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBufferRect
static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, short[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBufferRect
static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ByteBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, DoubleBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, FloatBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, IntBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.static int
clEnqueueWriteBufferRect
(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ShortBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.static int
clSetEventCallback
(long event, int command_exec_callback_type, CLEventCallbackI pfn_notify, long user_data) Registers a user callback function for a specific command execution status.static int
clSetMemObjectDestructorCallback
(long memobj, CLMemObjectDestructorCallbackI pfn_notify, long user_data) Registers a user callback function with a memory object.static int
clSetUserEventStatus
(long event, int execution_status) Sets the execution status of a user event object.static long
nclCreateSubBuffer
(long buffer, long flags, int buffer_create_type, long buffer_create_info, long errcode_ret) Unsafe version of:CreateSubBuffer
static long
nclCreateUserEvent
(long context, long errcode_ret) Unsafe version of:CreateUserEvent
static int
nclEnqueueCopyBufferRect
(long command_queue, long src_buffer, long dst_buffer, long src_origin, long dst_origin, long region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyBufferRect
static int
nclEnqueueReadBufferRect
(long command_queue, long buffer, int blocking_read, long buffer_origin, long host_origin, long region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueReadBufferRect
static int
nclEnqueueWriteBufferRect
(long command_queue, long buffer, int blocking_write, long buffer_origin, long host_origin, long region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueWriteBufferRect
static int
nclSetEventCallback
(long event, int command_exec_callback_type, long pfn_notify, long user_data) Unsafe version of:SetEventCallback
static int
nclSetMemObjectDestructorCallback
(long memobj, long pfn_notify, long user_data) Unsafe version of:SetMemObjectDestructorCallback
Methods inherited from class org.lwjgl.opencl.CL10
clBuildProgram, clBuildProgram, clBuildProgram, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateBuffer, clCreateCommandQueue, clCreateCommandQueue, clCreateContext, clCreateContext, clCreateContext, clCreateContextFromType, clCreateContextFromType, clCreateImage2D, clCreateImage2D, clCreateImage2D, clCreateImage2D, clCreateImage2D, clCreateImage2D, clCreateImage2D, clCreateImage2D, clCreateImage3D, clCreateImage3D, clCreateImage3D, clCreateImage3D, clCreateImage3D, clCreateImage3D, clCreateImage3D, clCreateImage3D, clCreateKernel, clCreateKernel, clCreateKernel, clCreateKernel, clCreateKernelsInProgram, clCreateKernelsInProgram, clCreateProgramWithBinary, clCreateProgramWithBinary, clCreateProgramWithBinary, clCreateProgramWithBinary, clCreateProgramWithSource, clCreateProgramWithSource, clCreateProgramWithSource, clCreateProgramWithSource, clCreateSampler, clCreateSampler, clEnqueueBarrier, clEnqueueCopyBuffer, clEnqueueCopyBufferToImage, clEnqueueCopyImage, clEnqueueCopyImageToBuffer, clEnqueueMapBuffer, clEnqueueMapBuffer, clEnqueueMapImage, clEnqueueMapImage, clEnqueueMapImage, clEnqueueMapImage, clEnqueueMarker, clEnqueueNativeKernel, clEnqueueNativeKernel, clEnqueueNDRangeKernel, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadBuffer, clEnqueueReadImage, clEnqueueReadImage, clEnqueueReadImage, clEnqueueReadImage, clEnqueueReadImage, clEnqueueReadImage, clEnqueueReadImage, clEnqueueReadImage, clEnqueueReadImage, clEnqueueTask, clEnqueueUnmapMemObject, clEnqueueWaitForEvents, clEnqueueWaitForEvents, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteBuffer, clEnqueueWriteImage, clEnqueueWriteImage, clEnqueueWriteImage, clEnqueueWriteImage, clEnqueueWriteImage, clEnqueueWriteImage, clEnqueueWriteImage, clEnqueueWriteImage, clEnqueueWriteImage, clFinish, clFlush, clGetCommandQueueInfo, clGetCommandQueueInfo, clGetCommandQueueInfo, clGetCommandQueueInfo, clGetCommandQueueInfo, clGetCommandQueueInfo, clGetContextInfo, clGetContextInfo, clGetContextInfo, clGetContextInfo, clGetDeviceIDs, clGetDeviceIDs, clGetDeviceInfo, clGetDeviceInfo, clGetDeviceInfo, clGetDeviceInfo, clGetDeviceInfo, clGetDeviceInfo, clGetEventInfo, clGetEventInfo, clGetEventInfo, clGetEventInfo, clGetEventProfilingInfo, clGetEventProfilingInfo, clGetEventProfilingInfo, clGetExtensionFunctionAddress, clGetExtensionFunctionAddress, clGetImageInfo, clGetImageInfo, clGetImageInfo, clGetImageInfo, clGetKernelInfo, clGetKernelInfo, clGetKernelInfo, clGetKernelInfo, clGetKernelWorkGroupInfo, clGetKernelWorkGroupInfo, clGetKernelWorkGroupInfo, clGetKernelWorkGroupInfo, clGetKernelWorkGroupInfo, clGetKernelWorkGroupInfo, clGetMemObjectInfo, clGetMemObjectInfo, clGetMemObjectInfo, clGetMemObjectInfo, clGetMemObjectInfo, clGetMemObjectInfo, clGetPlatformIDs, clGetPlatformIDs, clGetPlatformInfo, clGetPlatformInfo, clGetPlatformInfo, clGetProgramBuildInfo, clGetProgramBuildInfo, clGetProgramBuildInfo, clGetProgramBuildInfo, clGetProgramInfo, clGetProgramInfo, clGetProgramInfo, clGetProgramInfo, clGetSamplerInfo, clGetSamplerInfo, clGetSamplerInfo, clGetSamplerInfo, clGetSupportedImageFormats, clGetSupportedImageFormats, clReleaseCommandQueue, clReleaseContext, clReleaseEvent, clReleaseKernel, clReleaseMemObject, clReleaseProgram, clReleaseSampler, clRetainCommandQueue, clRetainContext, clRetainEvent, clRetainKernel, clRetainMemObject, clRetainProgram, clRetainSampler, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg, clSetKernelArg1b, clSetKernelArg1d, clSetKernelArg1f, clSetKernelArg1i, clSetKernelArg1l, clSetKernelArg1p, clSetKernelArg1s, clSetKernelArg2b, clSetKernelArg2d, clSetKernelArg2f, clSetKernelArg2i, clSetKernelArg2l, clSetKernelArg2p, clSetKernelArg2s, clSetKernelArg4b, clSetKernelArg4d, clSetKernelArg4f, clSetKernelArg4i, clSetKernelArg4l, clSetKernelArg4p, clSetKernelArg4s, clUnloadCompiler, clWaitForEvents, clWaitForEvents, nclBuildProgram, nclCreateBuffer, nclCreateCommandQueue, nclCreateContext, nclCreateContextFromType, nclCreateImage2D, nclCreateImage3D, nclCreateKernel, nclCreateKernelsInProgram, nclCreateProgramWithBinary, nclCreateProgramWithSource, nclCreateSampler, nclEnqueueCopyBuffer, nclEnqueueCopyBufferToImage, nclEnqueueCopyImage, nclEnqueueCopyImageToBuffer, nclEnqueueMapBuffer, nclEnqueueMapImage, nclEnqueueMarker, nclEnqueueNativeKernel, nclEnqueueNDRangeKernel, nclEnqueueReadBuffer, nclEnqueueReadImage, nclEnqueueTask, nclEnqueueUnmapMemObject, nclEnqueueWaitForEvents, nclEnqueueWriteBuffer, nclEnqueueWriteImage, nclGetCommandQueueInfo, nclGetContextInfo, nclGetDeviceIDs, nclGetDeviceInfo, nclGetEventInfo, nclGetEventProfilingInfo, nclGetExtensionFunctionAddress, nclGetImageInfo, nclGetKernelInfo, nclGetKernelWorkGroupInfo, nclGetMemObjectInfo, nclGetPlatformIDs, nclGetPlatformInfo, nclGetProgramBuildInfo, nclGetProgramInfo, nclGetSamplerInfo, nclGetSupportedImageFormats, nclSetKernelArg, nclWaitForEvents
-
Field Details
-
CL_MISALIGNED_SUB_BUFFER_OFFSET
public static final int CL_MISALIGNED_SUB_BUFFER_OFFSETError Codes.- See Also:
-
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
public static final int CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LISTError Codes.- See Also:
-
CL_INVALID_PROPERTY
public static final int CL_INVALID_PROPERTYError Codes.- See Also:
-
CL_VERSION_1_1
public static final int CL_VERSION_1_1OpenCL Version.- See Also:
-
CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF
public static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALFcl_device_info.- See Also:
-
CL_DEVICE_HOST_UNIFIED_MEMORY
public static final int CL_DEVICE_HOST_UNIFIED_MEMORYcl_device_info.- See Also:
-
CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR
public static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_CHARcl_device_info.- See Also:
-
CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT
public static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORTcl_device_info.- See Also:
-
CL_DEVICE_NATIVE_VECTOR_WIDTH_INT
public static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_INTcl_device_info.- See Also:
-
CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG
public static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_LONGcl_device_info.- See Also:
-
CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT
public static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOATcl_device_info.- See Also:
-
CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE
public static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLEcl_device_info.- See Also:
-
CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF
public static final int CL_DEVICE_NATIVE_VECTOR_WIDTH_HALFcl_device_info.- See Also:
-
CL_DEVICE_OPENCL_C_VERSION
public static final int CL_DEVICE_OPENCL_C_VERSIONcl_device_info.- See Also:
-
CL_FP_SOFT_FLOAT
public static final int CL_FP_SOFT_FLOATcl_device_fp_config - bitfield.- See Also:
-
CL_CONTEXT_NUM_DEVICES
public static final int CL_CONTEXT_NUM_DEVICEScl_context_info.- See Also:
-
CL_Rx
public static final int CL_Rxcl_channel_order.- See Also:
-
CL_RGx
public static final int CL_RGxcl_channel_order.- See Also:
-
CL_RGBx
public static final int CL_RGBxcl_channel_order.- See Also:
-
CL_MEM_ASSOCIATED_MEMOBJECT
public static final int CL_MEM_ASSOCIATED_MEMOBJECTcl_mem_info.- See Also:
-
CL_MEM_OFFSET
public static final int CL_MEM_OFFSETcl_mem_info.- See Also:
-
CL_ADDRESS_MIRRORED_REPEAT
public static final int CL_ADDRESS_MIRRORED_REPEATcl_addressing_mode.- See Also:
-
CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
public static final int CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLEcl_kernel_work_group_info.- See Also:
-
CL_KERNEL_PRIVATE_MEM_SIZE
public static final int CL_KERNEL_PRIVATE_MEM_SIZEcl_kernel_work_group_info.- See Also:
-
CL_EVENT_CONTEXT
public static final int CL_EVENT_CONTEXTcl_event_info.- See Also:
-
CL_COMMAND_READ_BUFFER_RECT
public static final int CL_COMMAND_READ_BUFFER_RECTcl_command_type.- See Also:
-
CL_COMMAND_WRITE_BUFFER_RECT
public static final int CL_COMMAND_WRITE_BUFFER_RECTcl_command_type.- See Also:
-
CL_COMMAND_COPY_BUFFER_RECT
public static final int CL_COMMAND_COPY_BUFFER_RECTcl_command_type.- See Also:
-
CL_COMMAND_USER
public static final int CL_COMMAND_USERcl_command_type.- See Also:
-
CL_BUFFER_CREATE_TYPE_REGION
public static final int CL_BUFFER_CREATE_TYPE_REGIONcl_buffer_create_type.- See Also:
-
-
Method Details
-
nclCreateSubBuffer
public static long nclCreateSubBuffer(long buffer, long flags, int buffer_create_type, long buffer_create_info, long errcode_ret) Unsafe version of:CreateSubBuffer
-
clCreateSubBuffer
public static long clCreateSubBuffer(long buffer, long flags, int buffer_create_type, ByteBuffer buffer_create_info, @Nullable IntBuffer errcode_ret) Creates a new buffer object (referred to as a sub-buffer object) from an existing buffer object.NOTE: Concurrent reading from, writing to and copying between both a buffer object and its sub-buffer object(s) is undefined. Concurrent reading from, writing to and copying between overlapping sub-buffer objects created with the same buffer object is undefined. Only reading from both a buffer object and its sub-buffer objects or reading from multiple overlapping sub-buffer objects is defined.
- Parameters:
buffer
- a valid buffer object and cannot be a sub-buffer objectflags
- a bit-field that is used to specify allocation and usage information about the sub-buffer memory object being created.If the
MEM_READ_WRITE
,MEM_READ_ONLY
orMEM_WRITE_ONLY
values are not specified in flags, they are inherited from the corresponding memory access qualifers associated with buffer. TheMEM_USE_HOST_PTR
,MEM_ALLOC_HOST_PTR
andMEM_COPY_HOST_PTR
values cannot be specified in flags but are inherited from the corresponding memory access qualifiers associated with buffer. IfMEM_COPY_HOST_PTR
is specified in the memory access qualifier values associated with buffer it does not imply any additional copies when the sub-buffer is created from buffer. If theMEM_HOST_WRITE_ONLY
,MEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
values are not specified in flags, they are inherited from the corresponding memory access qualifiers associated with buffer.buffer_create_type
- the type of buffer object to be created. Must be:BUFFER_CREATE_TYPE_REGION
buffer_create_info
- details about the buffer object to be created.When
buffer_create_type
isBUFFER_CREATE_TYPE_REGION
, thenbuffer_create_info
is a pointer to aCLBufferRegion
structure.(origin, size)
defines the offset and size in bytes in buffer.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors inerrcode_ret
:INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object or is a sub-buffer object.INVALID_VALUE
ifbuffer
was created withMEM_WRITE_ONLY
andflags
specifiesMEM_READ_WRITE
orMEM_READ_ONLY
, or ifbuffer
was created withMEM_READ_ONLY
andflags
specifiesMEM_READ_WRITE
orMEM_WRITE_ONLY
, or ifflags
specifiesMEM_USE_HOST_PTR
orMEM_ALLOC_HOST_PTR
orMEM_COPY_HOST_PTR
.INVALID_VALUE
ifbuffer
was created withMEM_HOST_WRITE_ONLY
andflags
specifyMEM_HOST_READ_ONLY
, or ifbuffer
was created withMEM_HOST_READ_ONLY
andflags
specifyMEM_HOST_WRITE_ONLY
, or ifbuffer
was created withMEM_HOST_NO_ACCESS
andflags
specifyMEM_HOST_READ_ONLY
orMEM_HOST_WRITE_ONLY
.INVALID_VALUE
if value specified inbuffer_create_type
is not valid.INVALID_VALUE
if value(s) specified inbuffer_create_info
(for a givenbuffer_create_type
) is not valid or ifbuffer_create_info
isNULL
.INVALID_BUFFER_SIZE
ifsize
is 0.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for sub-buffer object.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
nclSetMemObjectDestructorCallback
public static int nclSetMemObjectDestructorCallback(long memobj, long pfn_notify, long user_data) Unsafe version of:SetMemObjectDestructorCallback
-
clSetMemObjectDestructorCallback
public static int clSetMemObjectDestructorCallback(long memobj, CLMemObjectDestructorCallbackI pfn_notify, long user_data) Registers a user callback function with a memory object. Each call toclSetMemObjectDestructorCallback
registers the specified user callback function on a callback stack associated withmemobj
. The registered user callback functions are called in the reverse order in which they were registered. The user callback functions are called and then the memory object's resources are freed and the memory object is deleted. This provides a mechanism for the application (and libraries) usingmemobj
to be notified when the memory referenced byhost_ptr
, specified when the memory object is created and used as the storage bits for the memory object, can be reused or freed.- Parameters:
memobj
- a valid memory objectpfn_notify
- the callback function that can be registered by the application. This callback function may be called asynchronously by the OpenCL implementation. It is the application's responsibility to ensure that the callback function is thread-safe.user_data
- will be passed as theuser_data
argument whenpfn_notify
is called.user_data
can beNULL
.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_MEM_OBJECT
ifmemobj
is not a valid memory object.INVALID_VALUE
ifpfn_notify
is NULL.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
nclEnqueueReadBufferRect
public static int nclEnqueueReadBufferRect(long command_queue, long buffer, int blocking_read, long buffer_origin, long host_origin, long region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueReadBufferRect
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ByteBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.Calling
clEnqueueReadBufferRect
to read a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this buffer object or a memory object (buffer or image) created from this buffer object have finished execution before the read command begins execution.
- The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the read command has finished execution.
- Parameters:
command_queue
- the command-queue in which the read command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_read
- indicates if the read operation is blocking or nonblocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBufferRect
does not return until the buffer data has been read and copied into memory pointed to byptr
.If
blocking_read
isFALSE
i.e. the read command is non-blocking,clEnqueueReadBufferRect
queues a non-blocking read command and returns. The contents of the buffer thatptr
points to cannot be used until the read command has completed. Theevent
argument returns an event object which can be used to query the execution status of the read command. When the read command has completed, the contents of the buffer thatptr
points to can be used by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be read intoevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being read specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the read operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueReadBufferRect
is called on buffer which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ShortBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.Calling
clEnqueueReadBufferRect
to read a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this buffer object or a memory object (buffer or image) created from this buffer object have finished execution before the read command begins execution.
- The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the read command has finished execution.
- Parameters:
command_queue
- the command-queue in which the read command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_read
- indicates if the read operation is blocking or nonblocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBufferRect
does not return until the buffer data has been read and copied into memory pointed to byptr
.If
blocking_read
isFALSE
i.e. the read command is non-blocking,clEnqueueReadBufferRect
queues a non-blocking read command and returns. The contents of the buffer thatptr
points to cannot be used until the read command has completed. Theevent
argument returns an event object which can be used to query the execution status of the read command. When the read command has completed, the contents of the buffer thatptr
points to can be used by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be read intoevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being read specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the read operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueReadBufferRect
is called on buffer which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, IntBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.Calling
clEnqueueReadBufferRect
to read a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this buffer object or a memory object (buffer or image) created from this buffer object have finished execution before the read command begins execution.
- The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the read command has finished execution.
- Parameters:
command_queue
- the command-queue in which the read command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_read
- indicates if the read operation is blocking or nonblocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBufferRect
does not return until the buffer data has been read and copied into memory pointed to byptr
.If
blocking_read
isFALSE
i.e. the read command is non-blocking,clEnqueueReadBufferRect
queues a non-blocking read command and returns. The contents of the buffer thatptr
points to cannot be used until the read command has completed. Theevent
argument returns an event object which can be used to query the execution status of the read command. When the read command has completed, the contents of the buffer thatptr
points to can be used by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be read intoevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being read specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the read operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueReadBufferRect
is called on buffer which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, FloatBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.Calling
clEnqueueReadBufferRect
to read a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this buffer object or a memory object (buffer or image) created from this buffer object have finished execution before the read command begins execution.
- The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the read command has finished execution.
- Parameters:
command_queue
- the command-queue in which the read command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_read
- indicates if the read operation is blocking or nonblocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBufferRect
does not return until the buffer data has been read and copied into memory pointed to byptr
.If
blocking_read
isFALSE
i.e. the read command is non-blocking,clEnqueueReadBufferRect
queues a non-blocking read command and returns. The contents of the buffer thatptr
points to cannot be used until the read command has completed. Theevent
argument returns an event object which can be used to query the execution status of the read command. When the read command has completed, the contents of the buffer thatptr
points to can be used by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be read intoevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being read specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the read operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueReadBufferRect
is called on buffer which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, DoubleBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read a 2D or 3D rectangular region from a buffer object to host memory.Calling
clEnqueueReadBufferRect
to read a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this buffer object or a memory object (buffer or image) created from this buffer object have finished execution before the read command begins execution.
- The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the read command has finished execution.
- Parameters:
command_queue
- the command-queue in which the read command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_read
- indicates if the read operation is blocking or nonblocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBufferRect
does not return until the buffer data has been read and copied into memory pointed to byptr
.If
blocking_read
isFALSE
i.e. the read command is non-blocking,clEnqueueReadBufferRect
queues a non-blocking read command and returns. The contents of the buffer thatptr
points to cannot be used until the read command has completed. Theevent
argument returns an event object which can be used to query the execution status of the read command. When the read command has completed, the contents of the buffer thatptr
points to can be used by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be read intoevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being read specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the read operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueReadBufferRect
is called on buffer which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
nclEnqueueWriteBufferRect
public static int nclEnqueueWriteBufferRect(long command_queue, long buffer, int blocking_write, long buffer_origin, long host_origin, long region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueWriteBufferRect
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ByteBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.Calling
clEnqueueWriteBufferRect
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region given by
(buffer_origin region)
contains the latest bits when the enqueued write command begins execution. - The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the write command has finished execution.
- Parameters:
command_queue
- the command-queue in which the write command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_write
- indicates if the write operation is blocking or nonblocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write operation in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteBufferRect
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a non-blocking write. As the write is non-blocking the implementation can return immediately. The memory pointed to byptr
cannot be reused by the application after the call returns. Theevent
argument returns an event object which can be used to query the execution status of the write command. When the write command has completed, the memory pointed to byptr
can then be reused by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be written fromevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being written specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the write operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueWriteBufferRect
is called on buffer which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
- The host memory region given by
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, ShortBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.Calling
clEnqueueWriteBufferRect
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region given by
(buffer_origin region)
contains the latest bits when the enqueued write command begins execution. - The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the write command has finished execution.
- Parameters:
command_queue
- the command-queue in which the write command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_write
- indicates if the write operation is blocking or nonblocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write operation in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteBufferRect
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a non-blocking write. As the write is non-blocking the implementation can return immediately. The memory pointed to byptr
cannot be reused by the application after the call returns. Theevent
argument returns an event object which can be used to query the execution status of the write command. When the write command has completed, the memory pointed to byptr
can then be reused by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be written fromevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being written specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the write operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueWriteBufferRect
is called on buffer which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
- The host memory region given by
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, IntBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.Calling
clEnqueueWriteBufferRect
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region given by
(buffer_origin region)
contains the latest bits when the enqueued write command begins execution. - The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the write command has finished execution.
- Parameters:
command_queue
- the command-queue in which the write command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_write
- indicates if the write operation is blocking or nonblocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write operation in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteBufferRect
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a non-blocking write. As the write is non-blocking the implementation can return immediately. The memory pointed to byptr
cannot be reused by the application after the call returns. Theevent
argument returns an event object which can be used to query the execution status of the write command. When the write command has completed, the memory pointed to byptr
can then be reused by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be written fromevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being written specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the write operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueWriteBufferRect
is called on buffer which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
- The host memory region given by
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, FloatBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.Calling
clEnqueueWriteBufferRect
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region given by
(buffer_origin region)
contains the latest bits when the enqueued write command begins execution. - The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the write command has finished execution.
- Parameters:
command_queue
- the command-queue in which the write command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_write
- indicates if the write operation is blocking or nonblocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write operation in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteBufferRect
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a non-blocking write. As the write is non-blocking the implementation can return immediately. The memory pointed to byptr
cannot be reused by the application after the call returns. Theevent
argument returns an event object which can be used to query the execution status of the write command. When the write command has completed, the memory pointed to byptr
can then be reused by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be written fromevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being written specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the write operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueWriteBufferRect
is called on buffer which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
- The host memory region given by
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, DoubleBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write a 2D or 3D rectangular region to a buffer object from host memory.Calling
clEnqueueWriteBufferRect
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr
andhost_origin
,buffer_origin
values are the same, wherehost_ptr
is a pointer to the memory region specified when the buffer object being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region given by
(buffer_origin region)
contains the latest bits when the enqueued write command begins execution. - The buffer object or memory objects created from this buffer object are not mapped.
- The buffer object or memory objects created from this buffer object are not used by any command-queue until the write command has finished execution.
- Parameters:
command_queue
- the command-queue in which the write command will be queued.command_queue
andbuffer
must be created with the same OpenCL context.buffer
- a valid buffer objectblocking_write
- indicates if the write operation is blocking or nonblocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write operation in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteBufferRect
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a non-blocking write. As the write is non-blocking the implementation can return immediately. The memory pointed to byptr
cannot be reused by the application after the call returns. Theevent
argument returns an event object which can be used to query the execution status of the write command. When the write command has completed, the memory pointed to byptr
can then be reused by the application.buffer_origin
- the(x, y, z)
offset in the memory region associated withbuffer
. For a 2D rectangle region, the z value given bybuffer_origin[2]
should be 0. The offset in bytes is computed asbuffer_origin[2] * buffer_slice_pitch + buffer_origin[1] * buffer_row_pitch + buffer_origin[0]
.host_origin
- the(x, y, z)
offset in the memory region pointed to byptr
. For a 2D rectangle region, the z value given byhost_origin[2]
should be 0. The offset in bytes is computed ashost_origin[2] * host_slice_pitch + host_origin[1] * host_row_pitch + host_origin[0]
.region
- the (width in bytes, height in rows, depth in slices) of the 2D or 3D rectangle being read or written. For a 2D rectangle copy, the depth value given byregion[2]
should be 1. The values in region cannot be 0.buffer_row_pitch
- the length of each row in bytes to be used for the memory region associated withbuffer
. Ifbuffer_row_pitch
is 0,buffer_row_pitch
is computed asregion[0]
.buffer_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withbuffer
. Ifbuffer_slice_pitch
is 0,buffer_slice_pitch
is computed asregion[1] * buffer_row_pitch
.host_row_pitch
- the length of each row in bytes to be used for the memory region pointed to byptr
. Ifhost_row_pitch
is 0,host_row_pitch
is computed asregion[0]
.host_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region pointed to byptr
. Ifhost_slice_pitch
is 0,host_slice_pitch
is computed asregion[1] * host_row_pitch
.ptr
- the pointer to buffer in host memory where data is to be written fromevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
andbuffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifbuffer
is not a valid buffer object.INVALID_VALUE
if the region being written specified by(buffer_origin, region, buffer_row_pitch, buffer_slice_pitch)
is out of bounds.INVALID_VALUE
ifptr
is aNULL
value.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifbuffer_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifhost_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifbuffer_slice_pitch
is not 0 and is less thanregion[1] * buffer_row_pitch
and not a multiple ofbuffer_row_pitch
.INVALID_VALUE
ifhost_slice_pitch
is not 0 and is less thanregion[1] * host_row_pitch
and not a multiple ofhost_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MISALIGNED_SUB_BUFFER_OFFSET
ifbuffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the write operation is blocking and the execution status of any of the events inevent_wait_list
is a negative integer value.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withbuffer
.INVALID_OPERATION
ifclEnqueueWriteBufferRect
is called on buffer which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
- The host memory region given by
-
nclEnqueueCopyBufferRect
public static int nclEnqueueCopyBufferRect(long command_queue, long src_buffer, long dst_buffer, long src_origin, long dst_origin, long region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyBufferRect
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueCopyBufferRect
public static int clEnqueueCopyBufferRect(long command_queue, long src_buffer, long dst_buffer, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, long src_row_pitch, long src_slice_pitch, long dst_row_pitch, long dst_slice_pitch, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to copy a 2D or 3D rectangular region from the buffer object identified bysrc_buffer
to a 2D or 3D region in the buffer object identified bydst_buffer
. Copying begins at the source offset and destination offset which are computed as described below in the description forsrc_origin
anddst_origin
. Each byte of the region's width is copied from the source offset to the destination offset. After copying each width, the source and destination offsets are incremented by their respective source and destination row pitches. After copying each 2D rectangle, the source and destination offsets are incremented by their respective source and destination slice pitches.NOTE: If
src_buffer
anddst_buffer
are the same buffer object,src_row_pitch
must equaldst_row_pitch
andsrc_slice_pitch
must equaldst_slice_pitch
.- Parameters:
command_queue
- the command-queue in which the copy command will be queued. The OpenCL context associated withcommand_queue
,src_buffer
anddst_buffer
must be the same.src_buffer
- the source bufferdst_buffer
- the destination buffersrc_origin
- the(x, y, z)
offset in the memory region associated withsrc_buffer
. For a 2D rectangle region, the z value given bysrc_origin[2]
should be 0. The offset in bytes is computed assrc_origin[2] * src_slice_pitch + src_origin[1] * src_row_pitch + src_origin[0]
.dst_origin
- the(x, y, z)
offset in the memory region associated withdst_buffer
. For a 2D rectangle region, the z value given bydst_origin[2]
should be 0. The offset in bytes is computed asdst_origin[2] * dst_slice_pitch + dst_origin[1] * dst_row_pitch + dst_origin[0]
.region
- the (width
in bytes,height
in rows,depth
in slices) of the 2D or 3D rectangle being copied. For a 2D rectangle, the depth value given byregion[2]
should be 1. The values inregion
cannot be 0.src_row_pitch
- the length of each row in bytes to be used for the memory region associated withsrc_buffer
. Ifsrc_row_pitch
is 0,src_row_pitch
is computed asregion[0]
.src_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withsrc_buffer
. Ifsrc_slice_pitch
is 0,src_slice_pitch
is computed asregion[1] * src_row_pitch
.dst_row_pitch
- the length of each row in bytes to be used for the memory region associated withdst_buffer
. Ifdst_row_pitch
is 0,dst_row_pitch
is computed asregion[0]
.dst_slice_pitch
- the length of each 2D slice in bytes to be used for the memory region associated withdst_buffer
. Ifdst_slice_pitch
is 0,dst_slice_pitch
is computed asregion[1] * dst_row_pitch
.event_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_queue
must 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.event
can beNULL
in 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_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_wait_list
array.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if the context associated withcommand_queue
,src_buffer
anddst_buffer
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifsrc_buffer
anddst_buffer
are not valid buffer objects.INVALID_VALUE
if(src_origin, region, src_row_pitch, src_slice_pitch)
or(dst_origin, region, dst_row_pitch, dst_slice_pitch)
require accessing elements outside thesrc_buffer
anddst_buffer
buffer objects respectively.INVALID_VALUE
if anyregion
array element is 0.INVALID_VALUE
ifsrc_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifdst_row_pitch
is not 0 and is less thanregion[0]
.INVALID_VALUE
ifsrc_slice_pitch
is not 0 and is less thanregion[1] * src_row_pitch
or ifsrc_slice_pitch
is not 0 and is not a multiple ofsrc_row_pitch
.INVALID_VALUE
ifdst_slice_pitch
is not 0 and is less thanregion[1] * dst_row_pitch
or ifdst_slice_pitch
is not 0 and is not a multiple ofdst_row_pitch
.INVALID_VALUE
ifsrc_buffer
anddst_buffer
are the same buffer object andsrc_slice_pitch
is not equal todst_slice_pitch
andsrc_row_pitch
is not equal todst_row_pitch
.INVALID_EVENT_WAIT_LIST
ifevent_wait_list
isNULL
andnum_events_in_wait_list
> 0, orevent_wait_list
is notNULL
andnum_events_in_wait_list
is 0, or if event objects inevent_wait_list
are not valid events.MEM_COPY_OVERLAP
ifsrc_buffer
anddst_buffer
are the same buffer or subbuffer object and the source and destination regions overlap or ifsrc_buffer
anddst_buffer
are different sub-buffers of the same associated buffer object and they overlap.MISALIGNED_SUB_BUFFER_OFFSET
ifsrc_buffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.MISALIGNED_SUB_BUFFER_OFFSET
ifdst_buffer
is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withsrc_buffer
ordst_buffer
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
nclCreateUserEvent
public static long nclCreateUserEvent(long context, long errcode_ret) Unsafe version of:CreateUserEvent
-
clCreateUserEvent
Creates a user event object. User events allow applications to enqueue commands that wait on a user event to finish before the command is executed by the device.The execution status of the user event object created is set to
SUBMITTED
.- Parameters:
context
- a valid OpenCL contexterrcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero event object and
errcode_ret
is set toSUCCESS
if the user event object is created successfully. Otherwise, it returns aNULL
value with one of the following error values returned inerrcode_ret
:INVALID_CONTEXT
ifcontext
is not a valid context.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clSetUserEventStatus
public static int clSetUserEventStatus(long event, int execution_status) Sets the execution status of a user event object.NOTE: Enqueued commands that specify user events in the
event_wait_list
argument ofclEnqueue***
commands must ensure that the status of these user events being waited on are set usingclSetUserEventStatus
before any OpenCL APIs that release OpenCL objects except for event objects are called; otherwise the behavior is undefined.For example, the following code sequence will result in undefined behavior of
ReleaseMemObject
.ev1 = clCreateUserEvent(ctx, NULL); clEnqueueWriteBuffer(cq, buf1, CL_FALSE, ..., 1, &ev1, NULL); clEnqueueWriteBuffer(cq, buf2, CL_FALSE, ...); clReleaseMemObject(buf2); clSetUserEventStatus(ev1, CL_COMPLETE);
The following code sequence, however, works correctly.
ev1 = clCreateUserEvent(ctx, NULL); clEnqueueWriteBuffer(cq, buf1, CL_FALSE, ..., 1, &ev1, NULL); clEnqueueWriteBuffer(cq, buf2, CL_FALSE, ...); clSetUserEventStatus(ev1, CL_COMPLETE); clReleaseMemObject(buf2);
- Parameters:
event
- a user event object created usingCreateUserEvent
execution_status
- the new execution status to be set and can beCOMPLETE
or a negative integer value to indicate an error. A negative integer value causes all enqueued commands that wait on this user event to be terminated.clSetUserEventStatus
can only be called once to change the execution status of event.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_EVENT
ifevent
is not a valid user event object.INVALID_VALUE
if theexecution_status
is notCOMPLETE
or a negative integer value.INVALID_OPERATION
if theexecution_status
for event has already been changed by a previous call toclSetUserEventStatus
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
nclSetEventCallback
public static int nclSetEventCallback(long event, int command_exec_callback_type, long pfn_notify, long user_data) Unsafe version of:SetEventCallback
-
clSetEventCallback
public static int clSetEventCallback(long event, int command_exec_callback_type, CLEventCallbackI pfn_notify, long user_data) Registers a user callback function for a specific command execution status. The registered callback function will be called when the execution status of command associated with event changes to an execution status equal to or past the status specified bycommand_exec_status
.Each call to
clSetEventCallback
registers the specified user callback function on a callback stack associated with event. The order in which the registered user callback functions are called is undefined.All callbacks registered for an event object must be called. All enqueued callbacks shall be called before the event object is destroyed. Callbacks must return promptly. The behavior of calling expensive system routines, OpenCL API calls to create contexts or command-queues, or blocking OpenCL operations from the following list below, in a callback is undefined.
Finish
,WaitForEvents
,- blocking calls to
EnqueueReadBuffer
,EnqueueReadBufferRect
,EnqueueWriteBuffer
,EnqueueWriteBufferRect
, - blocking calls to
EnqueueReadImage
andEnqueueWriteImage
, - blocking calls to
EnqueueMapBuffer
andEnqueueMapImage
, - blocking calls to
BuildProgram
,CompileProgram
orLinkProgram
If an application needs to wait for completion of a routine from the above list in a callback, please use the non-blocking form of the function, and assign a completion callback to it to do the remainder of your work. Note that when a callback (or other code) enqueues commands to a command-queue, the commands are not required to begin execution until the queue is flushed. In standard usage, blocking enqueue calls serve this role by implicitly flushing the queue. Since blocking calls are not permitted in callbacks, those callbacks that enqueue commands on a command queue should either call
Flush
on the queue before returning or arrange forFlush
to be called later on another thread.- Parameters:
event
- a valid event objectcommand_exec_callback_type
- the command execution status for which the callback is registered. There is no guarantee that the callback functions registered for various execution status values for an event will be called in the exact order that the execution status of a command changes. Furthermore, it should be noted that receiving a call back for an event with a status other thanCOMPLETE
, in no way implies that the memory model or execution model as defined by the OpenCL specification has changed. For example, it is not valid to assume that a corresponding memory transfer has completed unless the event is in a stateCOMPLETE
. One of:SUBMITTED
RUNNING
COMPLETE
pfn_notify
- the event callback function that can be registered by the application. This callback function may be called asynchronously by the OpenCL implementation. It is the application's responsibility to ensure that the callback function is thread-safe.user_data
- will be passed as theuser_data
argument whenpfn_notify
is called.user_data
can beNULL
.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_EVENT
ifevent
is not a valid event object.INVALID_VALUE
ifpfn_event_notify
isNULL
or ifcommand_exec_callback_type
is notSUBMITTED
,RUNNING
orCOMPLETE
.INVALID_VALUE
ifevent
is a user event object andcommand_exec_callback_type
is notCOMPLETE
.OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clCreateSubBuffer
public static long clCreateSubBuffer(long buffer, long flags, int buffer_create_type, ByteBuffer buffer_create_info, @Nullable int[] errcode_ret) Array version of:CreateSubBuffer
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, short[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBufferRect
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, int[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBufferRect
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, float[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBufferRect
- See Also:
-
clEnqueueReadBufferRect
public static int clEnqueueReadBufferRect(long command_queue, long buffer, boolean blocking_read, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, double[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBufferRect
- See Also:
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, short[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBufferRect
- See Also:
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, int[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBufferRect
- See Also:
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, float[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBufferRect
- See Also:
-
clEnqueueWriteBufferRect
public static int clEnqueueWriteBufferRect(long command_queue, long buffer, boolean blocking_write, PointerBuffer buffer_origin, PointerBuffer host_origin, PointerBuffer region, long buffer_row_pitch, long buffer_slice_pitch, long host_row_pitch, long host_slice_pitch, double[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBufferRect
- See Also:
-
clCreateUserEvent
public static long clCreateUserEvent(long context, @Nullable int[] errcode_ret) Array version of:CreateUserEvent
- See Also:
-