Class CL10
- Direct Known Subclasses:
CL11
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
cl_channel_orderstatic final int
cl_addressing_modestatic final int
cl_addressing_modestatic final int
cl_addressing_modestatic final int
cl_addressing_modestatic final int
cl_channel_orderstatic final int
cl_channel_orderstatic final int
cl_build_statusstatic final int
cl_build_statusstatic final int
cl_build_statusstatic final int
Error Codesstatic final int
cl_build_statusstatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
cl_command_typestatic final int
Error Codesstatic final int
command execution statusstatic final int
cl_context_infostatic final int
cl_context_info + cl_context_propertiesstatic final int
cl_context_infostatic final int
cl_context_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
Error Codesstatic final int
Error Codesstatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_type - bitfieldstatic final int
cl_device_type - bitfieldstatic final int
cl_device_type - bitfieldstatic final int
cl_device_type - bitfieldstatic final int
cl_device_type - bitfieldstatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_device_infostatic final int
cl_event_infostatic final int
cl_event_infostatic final int
cl_event_infostatic final int
cl_event_infostatic final int
cl_device_exec_capabilities - bitfieldstatic final int
cl_device_exec_capabilities - bitfieldstatic final int
cl_boolstatic final int
cl_filter_modestatic final int
cl_filter_modestatic final int
cl_channel_typestatic final int
cl_device_fp_config - bitfieldstatic final int
cl_device_fp_config - bitfieldstatic final int
cl_device_fp_config - bitfieldstatic final int
cl_device_fp_config - bitfieldstatic final int
cl_device_fp_config - bitfieldstatic final int
cl_device_fp_config - bitfieldstatic final int
cl_device_local_mem_typestatic final int
cl_channel_typestatic final int
cl_image_infostatic final int
cl_image_infostatic final int
cl_image_infostatic final int
Error Codesstatic final int
Error Codesstatic final int
cl_image_infostatic final int
cl_image_infostatic final int
cl_image_infostatic final int
cl_image_infostatic final int
cl_channel_orderstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
Error Codesstatic final int
cl_kernel_work_group_infostatic final int
cl_kernel_infostatic final int
cl_kernel_infostatic final int
cl_kernel_work_group_infostatic final int
cl_kernel_infostatic final int
cl_kernel_infostatic final int
cl_kernel_infostatic final int
cl_kernel_work_group_infostatic final int
cl_device_local_mem_typestatic final int
cl_channel_orderstatic final int
Error Codesstatic final int
cl_map_flags - bitfieldstatic final int
cl_map_flags - bitfieldstatic final int
cl_mem_flags - bitfieldstatic final int
cl_mem_infostatic final int
cl_mem_flags - bitfieldstatic final int
Error Codesstatic final int
cl_mem_infostatic final int
cl_mem_infostatic final int
cl_mem_infostatic final int
Error Codesstatic final int
cl_mem_object_typestatic final int
cl_mem_object_typestatic final int
cl_mem_object_typestatic final int
cl_mem_flags - bitfieldstatic final int
cl_mem_flags - bitfieldstatic final int
cl_mem_infostatic final int
cl_mem_infostatic final int
cl_mem_infostatic final int
cl_mem_flags - bitfieldstatic final int
cl_mem_flags - bitfieldstatic final int
cl_device_mem_cache_typestatic final int
Error Codesstatic final int
Error Codesstatic final int
cl_platform_infostatic final int
cl_platform_infostatic final int
cl_platform_infostatic final int
cl_platform_infostatic final int
cl_platform_infostatic final int
cl_profiling_infostatic final int
cl_profiling_infostatic final int
cl_profiling_infostatic final int
cl_profiling_infostatic final int
Error Codesstatic final int
cl_program_infostatic final int
cl_program_infostatic final int
cl_program_build_infostatic final int
cl_program_build_infostatic final int
cl_program_build_infostatic final int
cl_program_infostatic final int
cl_program_infostatic final int
cl_program_infostatic final int
cl_program_infostatic final int
cl_program_infostatic final int
cl_command_queue_infostatic final int
cl_command_queue_infostatic final int
cl_command_queue_properties - bitfieldstatic final int
cl_command_queue_properties - bitfieldstatic final int
cl_command_queue_infostatic final int
cl_command_queue_infostatic final int
command execution statusstatic final int
cl_channel_orderstatic final int
cl_channel_orderstatic final int
cl_device_mem_cache_typestatic final int
cl_device_mem_cache_typestatic final int
cl_channel_orderstatic final int
cl_channel_orderstatic final int
cl_channel_orderstatic final int
command execution statusstatic final int
cl_sampler_infostatic final int
cl_sampler_infostatic final int
cl_sampler_infostatic final int
cl_sampler_infostatic final int
cl_sampler_infostatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
command execution statusstatic final int
Error Codesstatic final int
cl_boolstatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
cl_channel_typestatic final int
OpenCL Version -
Method Summary
Modifier and TypeMethodDescriptionstatic int
clBuildProgram
(long program, long device, CharSequence options, CLProgramCallbackI pfn_notify, long user_data) Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated withprogram
.static int
clBuildProgram
(long program, PointerBuffer device_list, CharSequence options, CLProgramCallbackI pfn_notify, long user_data) Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated withprogram
.static int
clBuildProgram
(long program, PointerBuffer device_list, ByteBuffer options, CLProgramCallbackI pfn_notify, long user_data) Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated withprogram
.static long
clCreateBuffer
(long context, long flags, double[] host_ptr, int[] errcode_ret) Array version of:CreateBuffer
static long
clCreateBuffer
(long context, long flags, float[] host_ptr, int[] errcode_ret) Array version of:CreateBuffer
static long
clCreateBuffer
(long context, long flags, int[] host_ptr, int[] errcode_ret) Array version of:CreateBuffer
static long
clCreateBuffer
(long context, long flags, long size, IntBuffer errcode_ret) Creates a buffer object.static long
clCreateBuffer
(long context, long flags, short[] host_ptr, int[] errcode_ret) Array version of:CreateBuffer
static long
clCreateBuffer
(long context, long flags, ByteBuffer host_ptr, int[] errcode_ret) Array version of:CreateBuffer
static long
clCreateBuffer
(long context, long flags, ByteBuffer host_ptr, IntBuffer errcode_ret) Creates a buffer object.static long
clCreateBuffer
(long context, long flags, DoubleBuffer host_ptr, IntBuffer errcode_ret) Creates a buffer object.static long
clCreateBuffer
(long context, long flags, FloatBuffer host_ptr, IntBuffer errcode_ret) Creates a buffer object.static long
clCreateBuffer
(long context, long flags, IntBuffer host_ptr, IntBuffer errcode_ret) Creates a buffer object.static long
clCreateBuffer
(long context, long flags, ShortBuffer host_ptr, IntBuffer errcode_ret) Creates a buffer object.static long
clCreateCommandQueue
(long context, long device, long properties, int[] errcode_ret) Array version of:CreateCommandQueue
static long
clCreateCommandQueue
(long context, long device, long properties, IntBuffer errcode_ret) Creates a command-queue on a specific device.static long
clCreateContext
(PointerBuffer properties, long device, CLContextCallbackI pfn_notify, long user_data, IntBuffer errcode_ret) Creates an OpenCL context.static long
clCreateContext
(PointerBuffer properties, PointerBuffer devices, CLContextCallbackI pfn_notify, long user_data, int[] errcode_ret) Array version of:CreateContext
static long
clCreateContext
(PointerBuffer properties, PointerBuffer devices, CLContextCallbackI pfn_notify, long user_data, IntBuffer errcode_ret) Creates an OpenCL context.static long
clCreateContextFromType
(PointerBuffer properties, long device_type, CLContextCallbackI pfn_notify, long user_data, int[] errcode_ret) Array version of:CreateContextFromType
static long
clCreateContextFromType
(PointerBuffer properties, long device_type, CLContextCallbackI pfn_notify, long user_data, IntBuffer errcode_ret) Creates a context using devices of the specified type.static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, float[] host_ptr, int[] errcode_ret) Array version of:CreateImage2D
static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, int[] host_ptr, int[] errcode_ret) Array version of:CreateImage2D
static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, short[] host_ptr, int[] errcode_ret) Array version of:CreateImage2D
static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, ByteBuffer host_ptr, int[] errcode_ret) Array version of:CreateImage2D
static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, ByteBuffer host_ptr, IntBuffer errcode_ret) Creates a 2D image object.static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, FloatBuffer host_ptr, IntBuffer errcode_ret) Creates a 2D image object.static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, IntBuffer host_ptr, IntBuffer errcode_ret) Creates a 2D image object.static long
clCreateImage2D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, ShortBuffer host_ptr, IntBuffer errcode_ret) Creates a 2D image object.static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, float[] host_ptr, int[] errcode_ret) Array version of:CreateImage3D
static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, int[] host_ptr, int[] errcode_ret) Array version of:CreateImage3D
static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, short[] host_ptr, int[] errcode_ret) Array version of:CreateImage3D
static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, ByteBuffer host_ptr, int[] errcode_ret) Array version of:CreateImage3D
static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, ByteBuffer host_ptr, IntBuffer errcode_ret) Creates a 3D image object.static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, FloatBuffer host_ptr, IntBuffer errcode_ret) Creates a 3D image object.static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, IntBuffer host_ptr, IntBuffer errcode_ret) Creates a 3D image object.static long
clCreateImage3D
(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, ShortBuffer host_ptr, IntBuffer errcode_ret) Creates a 3D image object.static long
clCreateKernel
(long program, CharSequence kernel_name, int[] errcode_ret) Array version of:CreateKernel
static long
clCreateKernel
(long program, CharSequence kernel_name, IntBuffer errcode_ret) Creates a kernel object.static long
clCreateKernel
(long program, ByteBuffer kernel_name, int[] errcode_ret) Array version of:CreateKernel
static long
clCreateKernel
(long program, ByteBuffer kernel_name, IntBuffer errcode_ret) Creates a kernel object.static int
clCreateKernelsInProgram
(long program, PointerBuffer kernels, int[] num_kernels_ret) Array version of:CreateKernelsInProgram
static int
clCreateKernelsInProgram
(long program, PointerBuffer kernels, IntBuffer num_kernels_ret) Creates kernel objects for all kernel functions inprogram
.static long
clCreateProgramWithBinary
(long context, PointerBuffer device_list, ByteBuffer[] binaries, IntBuffer binary_status, IntBuffer errcode_ret) Creates a program object for a context, and loads the binary bits specified bybinary
into the program object.static long
clCreateProgramWithBinary
(long context, PointerBuffer device_list, ByteBuffer binary, IntBuffer binary_status, IntBuffer errcode_ret) Creates a program object for a context, and loads the binary bits specified bybinary
into the program object.static long
clCreateProgramWithBinary
(long context, PointerBuffer device_list, PointerBuffer lengths, PointerBuffer binaries, int[] binary_status, int[] errcode_ret) Array version of:CreateProgramWithBinary
static long
clCreateProgramWithBinary
(long context, PointerBuffer device_list, PointerBuffer lengths, PointerBuffer binaries, IntBuffer binary_status, IntBuffer errcode_ret) Creates a program object for a context, and loads the binary bits specified bybinary
into the program object.static long
clCreateProgramWithSource
(long context, CharSequence[] strings, IntBuffer errcode_ret) Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object.static long
clCreateProgramWithSource
(long context, CharSequence string, IntBuffer errcode_ret) Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object.static long
clCreateProgramWithSource
(long context, PointerBuffer strings, PointerBuffer lengths, int[] errcode_ret) Array version of:CreateProgramWithSource
static long
clCreateProgramWithSource
(long context, PointerBuffer strings, PointerBuffer lengths, IntBuffer errcode_ret) Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object.static long
clCreateSampler
(long context, boolean normalized_coords, int addressing_mode, int filter_mode, int[] errcode_ret) Array version of:CreateSampler
static long
clCreateSampler
(long context, boolean normalized_coords, int addressing_mode, int filter_mode, IntBuffer errcode_ret) Creates a sampler object.static int
clEnqueueBarrier
(long command_queue) Enqueues a barrier operation.static int
clEnqueueCopyBuffer
(long command_queue, long src_buffer, long dst_buffer, long src_offset, long dst_offset, long size, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to copy a buffer object identified bysrc_buffer
to another buffer object identified bydst_buffer
.static int
clEnqueueCopyBufferToImage
(long command_queue, long src_buffer, long dst_image, long src_offset, PointerBuffer dst_origin, PointerBuffer region, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to copy a buffer object to an image object.static int
clEnqueueCopyImage
(long command_queue, long src_image, long dst_image, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to copy image objects.static int
clEnqueueCopyImageToBuffer
(long command_queue, long src_image, long dst_buffer, PointerBuffer src_origin, PointerBuffer region, long dst_offset, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to copy an image object to a buffer object.static ByteBuffer
clEnqueueMapBuffer
(long command_queue, long buffer, boolean blocking_map, long map_flags, long offset, long size, PointerBuffer event_wait_list, PointerBuffer event, int[] errcode_ret, ByteBuffer old_buffer) Array version of:EnqueueMapBuffer
static ByteBuffer
clEnqueueMapBuffer
(long command_queue, long buffer, boolean blocking_map, long map_flags, long offset, long size, PointerBuffer event_wait_list, PointerBuffer event, IntBuffer errcode_ret, ByteBuffer old_buffer) Enqueues a command to map a region of the buffer object given by buffer into the host address space and returns a pointer to this mapped region.static ByteBuffer
clEnqueueMapImage
(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, PointerBuffer image_slice_pitch, PointerBuffer event_wait_list, PointerBuffer event, int[] errcode_ret, long length, ByteBuffer old_buffer) Array version of:EnqueueMapImage
static ByteBuffer
clEnqueueMapImage
(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, PointerBuffer image_slice_pitch, PointerBuffer event_wait_list, PointerBuffer event, int[] errcode_ret, ByteBuffer old_buffer) Array version of:EnqueueMapImage
static ByteBuffer
clEnqueueMapImage
(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, PointerBuffer image_slice_pitch, PointerBuffer event_wait_list, PointerBuffer event, IntBuffer errcode_ret, long length, ByteBuffer old_buffer) Enqueues a command to map a region in the image object given byimage
into the host address space and returns a pointer to this mapped region.static ByteBuffer
clEnqueueMapImage
(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, PointerBuffer image_slice_pitch, PointerBuffer event_wait_list, PointerBuffer event, IntBuffer errcode_ret, ByteBuffer old_buffer) Enqueues a command to map a region in the image object given byimage
into the host address space and returns a pointer to this mapped region.static int
clEnqueueMarker
(long command_queue, PointerBuffer event) Enqueues a marker command tocommand_queue
.static int
clEnqueueNativeKernel
(long command_queue, CLNativeKernelI user_func, ByteBuffer args, long memobj, long memobj_loc, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to execute a native C/C++ function not compiled using the OpenCL compiler.static int
clEnqueueNativeKernel
(long command_queue, CLNativeKernelI user_func, ByteBuffer args, PointerBuffer mem_list, PointerBuffer args_mem_loc, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to execute a native C/C++ function not compiled using the OpenCL compiler.static int
clEnqueueNDRangeKernel
(long command_queue, long kernel, int work_dim, PointerBuffer global_work_offset, PointerBuffer global_work_size, PointerBuffer local_work_size, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to execute a kernel on a device.static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, double[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBuffer
static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, float[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBuffer
static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, int[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBuffer
static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, short[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadBuffer
static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, ByteBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from a buffer object to host memory.static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, DoubleBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from a buffer object to host memory.static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, FloatBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from a buffer object to host memory.static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, IntBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from a buffer object to host memory.static int
clEnqueueReadBuffer
(long command_queue, long buffer, boolean blocking_read, long offset, ShortBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from a buffer object to host memory.static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, double[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadImage
static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, float[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadImage
static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, int[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadImage
static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, short[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueReadImage
static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, ByteBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, DoubleBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, FloatBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, IntBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.static int
clEnqueueReadImage
(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, ShortBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.static int
clEnqueueTask
(long command_queue, long kernel, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to execute a kernel on a device.static int
clEnqueueUnmapMemObject
(long command_queue, long memobj, ByteBuffer mapped_ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to unmap a previously mapped region of a memory object.static int
clEnqueueWaitForEvents
(long command_queue, long event) Enqueues a wait for a specific event or a list of events to complete before any future commands queued in the command-queue are executed.static int
clEnqueueWaitForEvents
(long command_queue, PointerBuffer event_list) Enqueues a wait for a specific event or a list of events to complete before any future commands queued in the command-queue are executed.static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, double[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBuffer
static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, float[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBuffer
static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, int[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBuffer
static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, short[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteBuffer
static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, ByteBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to a buffer object from host memory.static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, DoubleBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to a buffer object from host memory.static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, FloatBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to a buffer object from host memory.static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, IntBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to a buffer object from host memory.static int
clEnqueueWriteBuffer
(long command_queue, long buffer, boolean blocking_write, long offset, ShortBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to a buffer object from host memory.static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, double[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteImage
static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, float[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteImage
static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, int[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteImage
static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, short[] ptr, PointerBuffer event_wait_list, PointerBuffer event) Array version of:EnqueueWriteImage
static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, ByteBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, DoubleBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, FloatBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, IntBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.static int
clEnqueueWriteImage
(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, ShortBuffer ptr, PointerBuffer event_wait_list, PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.static int
clFinish
(long command_queue) Blocks until all previously queued OpenCL commands incommand_queue
are issued to the associated device and have completed.static int
clFlush
(long command_queue) Issues all previously queued OpenCL commands incommand_queue
to the device associated withcommand_queue
.static int
clGetCommandQueueInfo
(long command_queue, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetCommandQueueInfo
static int
clGetCommandQueueInfo
(long command_queue, int param_name, long[] param_value, PointerBuffer param_value_size_ret) Array version of:GetCommandQueueInfo
static int
clGetCommandQueueInfo
(long command_queue, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Queries information about a command-queue.static int
clGetCommandQueueInfo
(long command_queue, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Queries information about a command-queue.static int
clGetCommandQueueInfo
(long command_queue, int param_name, LongBuffer param_value, PointerBuffer param_value_size_ret) Queries information about a command-queue.static int
clGetCommandQueueInfo
(long command_queue, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Queries information about a command-queue.static int
clGetContextInfo
(long context, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetContextInfo
static int
clGetContextInfo
(long context, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Queries information about a context.static int
clGetContextInfo
(long context, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Queries information about a context.static int
clGetContextInfo
(long context, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Queries information about a context.static int
clGetDeviceIDs
(long platform, long device_type, PointerBuffer devices, int[] num_devices) Array version of:GetDeviceIDs
static int
clGetDeviceIDs
(long platform, long device_type, PointerBuffer devices, IntBuffer num_devices) Obtains the list of devices available on a platform.static int
clGetDeviceInfo
(long device, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetDeviceInfo
static int
clGetDeviceInfo
(long device, int param_name, long[] param_value, PointerBuffer param_value_size_ret) Array version of:GetDeviceInfo
static int
clGetDeviceInfo
(long device, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.static int
clGetDeviceInfo
(long device, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.static int
clGetDeviceInfo
(long device, int param_name, LongBuffer param_value, PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.static int
clGetDeviceInfo
(long device, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.static int
clGetEventInfo
(long event, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetEventInfo
static int
clGetEventInfo
(long event, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information about an event object.static int
clGetEventInfo
(long event, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns information about an event object.static int
clGetEventInfo
(long event, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns information about an event object.static int
clGetEventProfilingInfo
(long event, int param_name, long[] param_value, PointerBuffer param_value_size_ret) Array version of:GetEventProfilingInfo
static int
clGetEventProfilingInfo
(long event, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns profiling information for the command associated withevent
.static int
clGetEventProfilingInfo
(long event, int param_name, LongBuffer param_value, PointerBuffer param_value_size_ret) Returns profiling information for the command associated withevent
.static long
clGetExtensionFunctionAddress
(CharSequence funcname) Returns the address of the extension function named byfuncname
.static long
clGetExtensionFunctionAddress
(ByteBuffer funcname) Returns the address of the extension function named byfuncname
.static int
clGetImageInfo
(long image, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetImageInfo
static int
clGetImageInfo
(long image, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information specific to an image object.static int
clGetImageInfo
(long image, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns information specific to an image object.static int
clGetImageInfo
(long image, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns information specific to an image object.static int
clGetKernelInfo
(long kernel, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetKernelInfo
static int
clGetKernelInfo
(long kernel, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a kernel object.static int
clGetKernelInfo
(long kernel, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a kernel object.static int
clGetKernelInfo
(long kernel, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a kernel object.static int
clGetKernelWorkGroupInfo
(long kernel, long device, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetKernelWorkGroupInfo
static int
clGetKernelWorkGroupInfo
(long kernel, long device, int param_name, long[] param_value, PointerBuffer param_value_size_ret) Array version of:GetKernelWorkGroupInfo
static int
clGetKernelWorkGroupInfo
(long kernel, long device, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.static int
clGetKernelWorkGroupInfo
(long kernel, long device, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.static int
clGetKernelWorkGroupInfo
(long kernel, long device, int param_name, LongBuffer param_value, PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.static int
clGetKernelWorkGroupInfo
(long kernel, long device, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.static int
clGetMemObjectInfo
(long memobj, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetMemObjectInfo
static int
clGetMemObjectInfo
(long memobj, int param_name, long[] param_value, PointerBuffer param_value_size_ret) Array version of:GetMemObjectInfo
static int
clGetMemObjectInfo
(long memobj, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).static int
clGetMemObjectInfo
(long memobj, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).static int
clGetMemObjectInfo
(long memobj, int param_name, LongBuffer param_value, PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).static int
clGetMemObjectInfo
(long memobj, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).static int
clGetPlatformIDs
(PointerBuffer platforms, int[] num_platforms) Array version of:GetPlatformIDs
static int
clGetPlatformIDs
(PointerBuffer platforms, IntBuffer num_platforms) Obtains the list of available platforms.static int
clGetPlatformInfo
(long platform, int param_name, long[] param_value, PointerBuffer param_value_size_ret) Array version of:GetPlatformInfo
static int
clGetPlatformInfo
(long platform, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information about the specified OpenCL platform.static int
clGetPlatformInfo
(long platform, int param_name, LongBuffer param_value, PointerBuffer param_value_size_ret) Returns information about the specified OpenCL platform.static int
clGetProgramBuildInfo
(long program, long device, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetProgramBuildInfo
static int
clGetProgramBuildInfo
(long program, long device, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns build information for each device in the program object.static int
clGetProgramBuildInfo
(long program, long device, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns build information for each device in the program object.static int
clGetProgramBuildInfo
(long program, long device, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns build information for each device in the program object.static int
clGetProgramInfo
(long program, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetProgramInfo
static int
clGetProgramInfo
(long program, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a program object.static int
clGetProgramInfo
(long program, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a program object.static int
clGetProgramInfo
(long program, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a program object.static int
clGetSamplerInfo
(long sampler, int param_name, int[] param_value, PointerBuffer param_value_size_ret) Array version of:GetSamplerInfo
static int
clGetSamplerInfo
(long sampler, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a sampler object.static int
clGetSamplerInfo
(long sampler, int param_name, IntBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a sampler object.static int
clGetSamplerInfo
(long sampler, int param_name, PointerBuffer param_value, PointerBuffer param_value_size_ret) Returns information about a sampler object.static int
clGetSupportedImageFormats
(long context, long flags, int image_type, CLImageFormat.Buffer image_formats, int[] num_image_formats) Array version of:GetSupportedImageFormats
static int
clGetSupportedImageFormats
(long context, long flags, int image_type, CLImageFormat.Buffer image_formats, IntBuffer num_image_formats) Can be used to get the list of image formats supported by an OpenCL implementation when the following information about an image memory object is specified: Context Image type – 1D, 2D, or 3D image, 1D image buffer, 1D or 2D image array Image object allocation informationstatic int
clReleaseCommandQueue
(long command_queue) Decrements thecommand_queue
reference count.static int
clReleaseContext
(long context) Decrements the context reference count.static int
clReleaseEvent
(long event) Decrements the event reference count.static int
clReleaseKernel
(long kernel) Decrements thekernel
reference count.static int
clReleaseMemObject
(long memobj) Decrements thememobj
reference count.static int
clReleaseProgram
(long program) Decrements theprogram
reference count.static int
clReleaseSampler
(long sampler) Decrements the sampler reference count.static int
clRetainCommandQueue
(long command_queue) Increments thecommand_queue
reference count.static int
clRetainContext
(long context) Increments the context reference count.static int
clRetainEvent
(long event) Increments the event reference count.static int
clRetainKernel
(long kernel) Increments thekernel
reference count.static int
clRetainMemObject
(long memobj) Increments thememobj
reference count.static int
clRetainProgram
(long program) Increments theprogram
reference count.static int
clRetainSampler
(long sampler) Increments the sampler reference count.static int
clSetKernelArg
(long kernel, int arg_index, double[] arg_value) Array version of:SetKernelArg
static int
clSetKernelArg
(long kernel, int arg_index, float[] arg_value) Array version of:SetKernelArg
static int
clSetKernelArg
(long kernel, int arg_index, int[] arg_value) Array version of:SetKernelArg
static int
clSetKernelArg
(long kernel, int arg_index, long arg_size) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg
(long kernel, int arg_index, long[] arg_value) Array version of:SetKernelArg
static int
clSetKernelArg
(long kernel, int arg_index, short[] arg_value) Array version of:SetKernelArg
static int
clSetKernelArg
(long kernel, int arg_index, ByteBuffer arg_value) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg
(long kernel, int arg_index, DoubleBuffer arg_value) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg
(long kernel, int arg_index, FloatBuffer arg_value) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg
(long kernel, int arg_index, IntBuffer arg_value) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg
(long kernel, int arg_index, LongBuffer arg_value) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg
(long kernel, int arg_index, ShortBuffer arg_value) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg
(long kernel, int arg_index, PointerBuffer arg_value) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg1b
(long kernel, int arg_index, byte arg0) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg1d
(long kernel, int arg_index, double arg0) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg1f
(long kernel, int arg_index, float arg0) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg1i
(long kernel, int arg_index, int arg0) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg1l
(long kernel, int arg_index, long arg0) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg1p
(long kernel, int arg_index, long arg0) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg1s
(long kernel, int arg_index, short arg0) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg2b
(long kernel, int arg_index, byte arg0, byte arg1) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg2d
(long kernel, int arg_index, double arg0, double arg1) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg2f
(long kernel, int arg_index, float arg0, float arg1) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg2i
(long kernel, int arg_index, int arg0, int arg1) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg2l
(long kernel, int arg_index, long arg0, long arg1) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg2p
(long kernel, int arg_index, long arg0, long arg1) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg2s
(long kernel, int arg_index, short arg0, short arg1) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg4b
(long kernel, int arg_index, byte arg0, byte arg1, byte arg2, byte arg3) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg4d
(long kernel, int arg_index, double arg0, double arg1, double arg2, double arg3) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg4f
(long kernel, int arg_index, float arg0, float arg1, float arg2, float arg3) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg4i
(long kernel, int arg_index, int arg0, int arg1, int arg2, int arg3) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg4l
(long kernel, int arg_index, long arg0, long arg1, long arg2, long arg3) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg4p
(long kernel, int arg_index, long arg0, long arg1, long arg2, long arg3) Set the argument value for a specific argument of a kernel.static int
clSetKernelArg4s
(long kernel, int arg_index, short arg0, short arg1, short arg2, short arg3) Set the argument value for a specific argument of a kernel.static int
Allows the implementation to release the resources allocated by the OpenCL compiler.static int
clWaitForEvents
(long event) Waits on the host thread for commands identified by event objects inevent_list
to complete.static int
clWaitForEvents
(PointerBuffer event_list) Waits on the host thread for commands identified by event objects inevent_list
to complete.static int
nclBuildProgram
(long program, int num_devices, long device_list, long options, long pfn_notify, long user_data) Unsafe version of:BuildProgram
static long
nclCreateBuffer
(long context, long flags, long size, long host_ptr, long errcode_ret) Unsafe version of:CreateBuffer
static long
nclCreateCommandQueue
(long context, long device, long properties, long errcode_ret) Unsafe version of:CreateCommandQueue
static long
nclCreateContext
(long properties, int num_devices, long devices, long pfn_notify, long user_data, long errcode_ret) Unsafe version of:CreateContext
static long
nclCreateContextFromType
(long properties, long device_type, long pfn_notify, long user_data, long errcode_ret) Unsafe version of:CreateContextFromType
static long
nclCreateImage2D
(long context, long flags, long image_format, long image_width, long image_height, long image_row_pitch, long host_ptr, long errcode_ret) Unsafe version of:CreateImage2D
static long
nclCreateImage3D
(long context, long flags, long image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, long host_ptr, long errcode_ret) Unsafe version of:CreateImage3D
static long
nclCreateKernel
(long program, long kernel_name, long errcode_ret) Unsafe version of:CreateKernel
static int
nclCreateKernelsInProgram
(long program, int num_kernels, long kernels, long num_kernels_ret) Unsafe version of:CreateKernelsInProgram
static long
nclCreateProgramWithBinary
(long context, int num_devices, long device_list, long lengths, long binaries, long binary_status, long errcode_ret) Unsafe version of:CreateProgramWithBinary
static long
nclCreateProgramWithSource
(long context, int count, long strings, long lengths, long errcode_ret) Unsafe version of:CreateProgramWithSource
static long
nclCreateSampler
(long context, int normalized_coords, int addressing_mode, int filter_mode, long errcode_ret) Unsafe version of:CreateSampler
static int
nclEnqueueCopyBuffer
(long command_queue, long src_buffer, long dst_buffer, long src_offset, long dst_offset, long size, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyBuffer
static int
nclEnqueueCopyBufferToImage
(long command_queue, long src_buffer, long dst_image, long src_offset, long dst_origin, long region, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyBufferToImage
static int
nclEnqueueCopyImage
(long command_queue, long src_image, long dst_image, long src_origin, long dst_origin, long region, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyImage
static int
nclEnqueueCopyImageToBuffer
(long command_queue, long src_image, long dst_buffer, long src_origin, long region, long dst_offset, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyImageToBuffer
static long
nclEnqueueMapBuffer
(long command_queue, long buffer, int blocking_map, long map_flags, long offset, long size, int num_events_in_wait_list, long event_wait_list, long event, long errcode_ret) Unsafe version of:EnqueueMapBuffer
static long
nclEnqueueMapImage
(long command_queue, long image, int blocking_map, long map_flags, long origin, long region, long image_row_pitch, long image_slice_pitch, int num_events_in_wait_list, long event_wait_list, long event, long errcode_ret) Unsafe version of:EnqueueMapImage
static int
nclEnqueueMarker
(long command_queue, long event) Unsafe version of:EnqueueMarker
static int
nclEnqueueNativeKernel
(long command_queue, long user_func, long args, long cb_args, int num_mem_objects, long mem_list, long args_mem_loc, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueNativeKernel
static int
nclEnqueueNDRangeKernel
(long command_queue, long kernel, int work_dim, long global_work_offset, long global_work_size, long local_work_size, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueNDRangeKernel
static int
nclEnqueueReadBuffer
(long command_queue, long buffer, int blocking_read, long offset, long size, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueReadBuffer
static int
nclEnqueueReadImage
(long command_queue, long image, int blocking_read, long origin, long region, long row_pitch, long slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueReadImage
static int
nclEnqueueTask
(long command_queue, long kernel, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueTask
static int
nclEnqueueUnmapMemObject
(long command_queue, long memobj, long mapped_ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueUnmapMemObject
static int
nclEnqueueWaitForEvents
(long command_queue, int num_events, long event_list) Unsafe version of:EnqueueWaitForEvents
static int
nclEnqueueWriteBuffer
(long command_queue, long buffer, int blocking_write, long offset, long size, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueWriteBuffer
static int
nclEnqueueWriteImage
(long command_queue, long image, int blocking_write, long origin, long region, long input_row_pitch, long input_slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueWriteImage
static int
nclGetCommandQueueInfo
(long command_queue, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetCommandQueueInfo
static int
nclGetContextInfo
(long context, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetContextInfo
static int
nclGetDeviceIDs
(long platform, long device_type, int num_entries, long devices, long num_devices) Unsafe version of:GetDeviceIDs
static int
nclGetDeviceInfo
(long device, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetDeviceInfo
static int
nclGetEventInfo
(long event, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetEventInfo
static int
nclGetEventProfilingInfo
(long event, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetEventProfilingInfo
static long
nclGetExtensionFunctionAddress
(long funcname) Unsafe version of:GetExtensionFunctionAddress
static int
nclGetImageInfo
(long image, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetImageInfo
static int
nclGetKernelInfo
(long kernel, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetKernelInfo
static int
nclGetKernelWorkGroupInfo
(long kernel, long device, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetKernelWorkGroupInfo
static int
nclGetMemObjectInfo
(long memobj, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetMemObjectInfo
static int
nclGetPlatformIDs
(int num_entries, long platforms, long num_platforms) Unsafe version of:GetPlatformIDs
static int
nclGetPlatformInfo
(long platform, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetPlatformInfo
static int
nclGetProgramBuildInfo
(long program, long device, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetProgramBuildInfo
static int
nclGetProgramInfo
(long program, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetProgramInfo
static int
nclGetSamplerInfo
(long sampler, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetSamplerInfo
static int
nclGetSupportedImageFormats
(long context, long flags, int image_type, int num_entries, long image_formats, long num_image_formats) Unsafe version of:GetSupportedImageFormats
static int
nclSetKernelArg
(long kernel, int arg_index, long arg_size, long arg_value) Unsafe version of:SetKernelArg
static int
nclWaitForEvents
(int num_events, long event_list) Unsafe version of:WaitForEvents
-
Field Details
-
CL_SUCCESS
public static final int CL_SUCCESSError Codes- See Also:
-
CL_DEVICE_NOT_FOUND
public static final int CL_DEVICE_NOT_FOUNDError Codes- See Also:
-
CL_DEVICE_NOT_AVAILABLE
public static final int CL_DEVICE_NOT_AVAILABLEError Codes- See Also:
-
CL_COMPILER_NOT_AVAILABLE
public static final int CL_COMPILER_NOT_AVAILABLEError Codes- See Also:
-
CL_MEM_OBJECT_ALLOCATION_FAILURE
public static final int CL_MEM_OBJECT_ALLOCATION_FAILUREError Codes- See Also:
-
CL_OUT_OF_RESOURCES
public static final int CL_OUT_OF_RESOURCESError Codes- See Also:
-
CL_OUT_OF_HOST_MEMORY
public static final int CL_OUT_OF_HOST_MEMORYError Codes- See Also:
-
CL_PROFILING_INFO_NOT_AVAILABLE
public static final int CL_PROFILING_INFO_NOT_AVAILABLEError Codes- See Also:
-
CL_MEM_COPY_OVERLAP
public static final int CL_MEM_COPY_OVERLAPError Codes- See Also:
-
CL_IMAGE_FORMAT_MISMATCH
public static final int CL_IMAGE_FORMAT_MISMATCHError Codes- See Also:
-
CL_IMAGE_FORMAT_NOT_SUPPORTED
public static final int CL_IMAGE_FORMAT_NOT_SUPPORTEDError Codes- See Also:
-
CL_BUILD_PROGRAM_FAILURE
public static final int CL_BUILD_PROGRAM_FAILUREError Codes- See Also:
-
CL_MAP_FAILURE
public static final int CL_MAP_FAILUREError Codes- See Also:
-
CL_INVALID_VALUE
public static final int CL_INVALID_VALUEError Codes- See Also:
-
CL_INVALID_DEVICE_TYPE
public static final int CL_INVALID_DEVICE_TYPEError Codes- See Also:
-
CL_INVALID_PLATFORM
public static final int CL_INVALID_PLATFORMError Codes- See Also:
-
CL_INVALID_DEVICE
public static final int CL_INVALID_DEVICEError Codes- See Also:
-
CL_INVALID_CONTEXT
public static final int CL_INVALID_CONTEXTError Codes- See Also:
-
CL_INVALID_QUEUE_PROPERTIES
public static final int CL_INVALID_QUEUE_PROPERTIESError Codes- See Also:
-
CL_INVALID_COMMAND_QUEUE
public static final int CL_INVALID_COMMAND_QUEUEError Codes- See Also:
-
CL_INVALID_HOST_PTR
public static final int CL_INVALID_HOST_PTRError Codes- See Also:
-
CL_INVALID_MEM_OBJECT
public static final int CL_INVALID_MEM_OBJECTError Codes- See Also:
-
CL_INVALID_IMAGE_FORMAT_DESCRIPTOR
public static final int CL_INVALID_IMAGE_FORMAT_DESCRIPTORError Codes- See Also:
-
CL_INVALID_IMAGE_SIZE
public static final int CL_INVALID_IMAGE_SIZEError Codes- See Also:
-
CL_INVALID_SAMPLER
public static final int CL_INVALID_SAMPLERError Codes- See Also:
-
CL_INVALID_BINARY
public static final int CL_INVALID_BINARYError Codes- See Also:
-
CL_INVALID_BUILD_OPTIONS
public static final int CL_INVALID_BUILD_OPTIONSError Codes- See Also:
-
CL_INVALID_PROGRAM
public static final int CL_INVALID_PROGRAMError Codes- See Also:
-
CL_INVALID_PROGRAM_EXECUTABLE
public static final int CL_INVALID_PROGRAM_EXECUTABLEError Codes- See Also:
-
CL_INVALID_KERNEL_NAME
public static final int CL_INVALID_KERNEL_NAMEError Codes- See Also:
-
CL_INVALID_KERNEL_DEFINITION
public static final int CL_INVALID_KERNEL_DEFINITIONError Codes- See Also:
-
CL_INVALID_KERNEL
public static final int CL_INVALID_KERNELError Codes- See Also:
-
CL_INVALID_ARG_INDEX
public static final int CL_INVALID_ARG_INDEXError Codes- See Also:
-
CL_INVALID_ARG_VALUE
public static final int CL_INVALID_ARG_VALUEError Codes- See Also:
-
CL_INVALID_ARG_SIZE
public static final int CL_INVALID_ARG_SIZEError Codes- See Also:
-
CL_INVALID_KERNEL_ARGS
public static final int CL_INVALID_KERNEL_ARGSError Codes- See Also:
-
CL_INVALID_WORK_DIMENSION
public static final int CL_INVALID_WORK_DIMENSIONError Codes- See Also:
-
CL_INVALID_WORK_GROUP_SIZE
public static final int CL_INVALID_WORK_GROUP_SIZEError Codes- See Also:
-
CL_INVALID_WORK_ITEM_SIZE
public static final int CL_INVALID_WORK_ITEM_SIZEError Codes- See Also:
-
CL_INVALID_GLOBAL_OFFSET
public static final int CL_INVALID_GLOBAL_OFFSETError Codes- See Also:
-
CL_INVALID_EVENT_WAIT_LIST
public static final int CL_INVALID_EVENT_WAIT_LISTError Codes- See Also:
-
CL_INVALID_EVENT
public static final int CL_INVALID_EVENTError Codes- See Also:
-
CL_INVALID_OPERATION
public static final int CL_INVALID_OPERATIONError Codes- See Also:
-
CL_INVALID_BUFFER_SIZE
public static final int CL_INVALID_BUFFER_SIZEError Codes- See Also:
-
CL_INVALID_GLOBAL_WORK_SIZE
public static final int CL_INVALID_GLOBAL_WORK_SIZEError Codes- See Also:
-
CL_VERSION_1_0
public static final int CL_VERSION_1_0OpenCL Version- See Also:
-
CL_FALSE
public static final int CL_FALSEcl_bool- See Also:
-
CL_TRUE
public static final int CL_TRUEcl_bool- See Also:
-
CL_PLATFORM_PROFILE
public static final int CL_PLATFORM_PROFILEcl_platform_info- See Also:
-
CL_PLATFORM_VERSION
public static final int CL_PLATFORM_VERSIONcl_platform_info- See Also:
-
CL_PLATFORM_NAME
public static final int CL_PLATFORM_NAMEcl_platform_info- See Also:
-
CL_PLATFORM_VENDOR
public static final int CL_PLATFORM_VENDORcl_platform_info- See Also:
-
CL_PLATFORM_EXTENSIONS
public static final int CL_PLATFORM_EXTENSIONScl_platform_info- See Also:
-
CL_DEVICE_TYPE_DEFAULT
public static final int CL_DEVICE_TYPE_DEFAULTcl_device_type - bitfield- See Also:
-
CL_DEVICE_TYPE_CPU
public static final int CL_DEVICE_TYPE_CPUcl_device_type - bitfield- See Also:
-
CL_DEVICE_TYPE_GPU
public static final int CL_DEVICE_TYPE_GPUcl_device_type - bitfield- See Also:
-
CL_DEVICE_TYPE_ACCELERATOR
public static final int CL_DEVICE_TYPE_ACCELERATORcl_device_type - bitfield- See Also:
-
CL_DEVICE_TYPE_ALL
public static final int CL_DEVICE_TYPE_ALLcl_device_type - bitfield- See Also:
-
CL_DEVICE_TYPE
public static final int CL_DEVICE_TYPEcl_device_info- See Also:
-
CL_DEVICE_VENDOR_ID
public static final int CL_DEVICE_VENDOR_IDcl_device_info- See Also:
-
CL_DEVICE_MAX_COMPUTE_UNITS
public static final int CL_DEVICE_MAX_COMPUTE_UNITScl_device_info- See Also:
-
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
public static final int CL_DEVICE_MAX_WORK_ITEM_DIMENSIONScl_device_info- See Also:
-
CL_DEVICE_MAX_WORK_GROUP_SIZE
public static final int CL_DEVICE_MAX_WORK_GROUP_SIZEcl_device_info- See Also:
-
CL_DEVICE_MAX_WORK_ITEM_SIZES
public static final int CL_DEVICE_MAX_WORK_ITEM_SIZEScl_device_info- See Also:
-
CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR
public static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHARcl_device_info- See Also:
-
CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT
public static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORTcl_device_info- See Also:
-
CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT
public static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_INTcl_device_info- See Also:
-
CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG
public static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONGcl_device_info- See Also:
-
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT
public static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOATcl_device_info- See Also:
-
CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE
public static final int CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLEcl_device_info- See Also:
-
CL_DEVICE_MAX_CLOCK_FREQUENCY
public static final int CL_DEVICE_MAX_CLOCK_FREQUENCYcl_device_info- See Also:
-
CL_DEVICE_ADDRESS_BITS
public static final int CL_DEVICE_ADDRESS_BITScl_device_info- See Also:
-
CL_DEVICE_MAX_READ_IMAGE_ARGS
public static final int CL_DEVICE_MAX_READ_IMAGE_ARGScl_device_info- See Also:
-
CL_DEVICE_MAX_WRITE_IMAGE_ARGS
public static final int CL_DEVICE_MAX_WRITE_IMAGE_ARGScl_device_info- See Also:
-
CL_DEVICE_MAX_MEM_ALLOC_SIZE
public static final int CL_DEVICE_MAX_MEM_ALLOC_SIZEcl_device_info- See Also:
-
CL_DEVICE_IMAGE2D_MAX_WIDTH
public static final int CL_DEVICE_IMAGE2D_MAX_WIDTHcl_device_info- See Also:
-
CL_DEVICE_IMAGE2D_MAX_HEIGHT
public static final int CL_DEVICE_IMAGE2D_MAX_HEIGHTcl_device_info- See Also:
-
CL_DEVICE_IMAGE3D_MAX_WIDTH
public static final int CL_DEVICE_IMAGE3D_MAX_WIDTHcl_device_info- See Also:
-
CL_DEVICE_IMAGE3D_MAX_HEIGHT
public static final int CL_DEVICE_IMAGE3D_MAX_HEIGHTcl_device_info- See Also:
-
CL_DEVICE_IMAGE3D_MAX_DEPTH
public static final int CL_DEVICE_IMAGE3D_MAX_DEPTHcl_device_info- See Also:
-
CL_DEVICE_IMAGE_SUPPORT
public static final int CL_DEVICE_IMAGE_SUPPORTcl_device_info- See Also:
-
CL_DEVICE_MAX_PARAMETER_SIZE
public static final int CL_DEVICE_MAX_PARAMETER_SIZEcl_device_info- See Also:
-
CL_DEVICE_MAX_SAMPLERS
public static final int CL_DEVICE_MAX_SAMPLERScl_device_info- See Also:
-
CL_DEVICE_MEM_BASE_ADDR_ALIGN
public static final int CL_DEVICE_MEM_BASE_ADDR_ALIGNcl_device_info- See Also:
-
CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE
public static final int CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZEcl_device_info- See Also:
-
CL_DEVICE_SINGLE_FP_CONFIG
public static final int CL_DEVICE_SINGLE_FP_CONFIGcl_device_info- See Also:
-
CL_DEVICE_GLOBAL_MEM_CACHE_TYPE
public static final int CL_DEVICE_GLOBAL_MEM_CACHE_TYPEcl_device_info- See Also:
-
CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE
public static final int CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZEcl_device_info- See Also:
-
CL_DEVICE_GLOBAL_MEM_CACHE_SIZE
public static final int CL_DEVICE_GLOBAL_MEM_CACHE_SIZEcl_device_info- See Also:
-
CL_DEVICE_GLOBAL_MEM_SIZE
public static final int CL_DEVICE_GLOBAL_MEM_SIZEcl_device_info- See Also:
-
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE
public static final int CL_DEVICE_MAX_CONSTANT_BUFFER_SIZEcl_device_info- See Also:
-
CL_DEVICE_MAX_CONSTANT_ARGS
public static final int CL_DEVICE_MAX_CONSTANT_ARGScl_device_info- See Also:
-
CL_DEVICE_LOCAL_MEM_TYPE
public static final int CL_DEVICE_LOCAL_MEM_TYPEcl_device_info- See Also:
-
CL_DEVICE_LOCAL_MEM_SIZE
public static final int CL_DEVICE_LOCAL_MEM_SIZEcl_device_info- See Also:
-
CL_DEVICE_ERROR_CORRECTION_SUPPORT
public static final int CL_DEVICE_ERROR_CORRECTION_SUPPORTcl_device_info- See Also:
-
CL_DEVICE_PROFILING_TIMER_RESOLUTION
public static final int CL_DEVICE_PROFILING_TIMER_RESOLUTIONcl_device_info- See Also:
-
CL_DEVICE_ENDIAN_LITTLE
public static final int CL_DEVICE_ENDIAN_LITTLEcl_device_info- See Also:
-
CL_DEVICE_AVAILABLE
public static final int CL_DEVICE_AVAILABLEcl_device_info- See Also:
-
CL_DEVICE_COMPILER_AVAILABLE
public static final int CL_DEVICE_COMPILER_AVAILABLEcl_device_info- See Also:
-
CL_DEVICE_EXECUTION_CAPABILITIES
public static final int CL_DEVICE_EXECUTION_CAPABILITIEScl_device_info- See Also:
-
CL_DEVICE_QUEUE_PROPERTIES
public static final int CL_DEVICE_QUEUE_PROPERTIEScl_device_info- See Also:
-
CL_DEVICE_NAME
public static final int CL_DEVICE_NAMEcl_device_info- See Also:
-
CL_DEVICE_VENDOR
public static final int CL_DEVICE_VENDORcl_device_info- See Also:
-
CL_DRIVER_VERSION
public static final int CL_DRIVER_VERSIONcl_device_info- See Also:
-
CL_DEVICE_PROFILE
public static final int CL_DEVICE_PROFILEcl_device_info- See Also:
-
CL_DEVICE_VERSION
public static final int CL_DEVICE_VERSIONcl_device_info- See Also:
-
CL_DEVICE_EXTENSIONS
public static final int CL_DEVICE_EXTENSIONScl_device_info- See Also:
-
CL_DEVICE_PLATFORM
public static final int CL_DEVICE_PLATFORMcl_device_info- See Also:
-
CL_FP_DENORM
public static final int CL_FP_DENORMcl_device_fp_config - bitfield- See Also:
-
CL_FP_INF_NAN
public static final int CL_FP_INF_NANcl_device_fp_config - bitfield- See Also:
-
CL_FP_ROUND_TO_NEAREST
public static final int CL_FP_ROUND_TO_NEARESTcl_device_fp_config - bitfield- See Also:
-
CL_FP_ROUND_TO_ZERO
public static final int CL_FP_ROUND_TO_ZEROcl_device_fp_config - bitfield- See Also:
-
CL_FP_ROUND_TO_INF
public static final int CL_FP_ROUND_TO_INFcl_device_fp_config - bitfield- See Also:
-
CL_FP_FMA
public static final int CL_FP_FMAcl_device_fp_config - bitfield- See Also:
-
CL_NONE
public static final int CL_NONEcl_device_mem_cache_type- See Also:
-
CL_READ_ONLY_CACHE
public static final int CL_READ_ONLY_CACHEcl_device_mem_cache_type- See Also:
-
CL_READ_WRITE_CACHE
public static final int CL_READ_WRITE_CACHEcl_device_mem_cache_type- See Also:
-
CL_LOCAL
public static final int CL_LOCALcl_device_local_mem_type- See Also:
-
CL_GLOBAL
public static final int CL_GLOBALcl_device_local_mem_type- See Also:
-
CL_EXEC_KERNEL
public static final int CL_EXEC_KERNELcl_device_exec_capabilities - bitfield- See Also:
-
CL_EXEC_NATIVE_KERNEL
public static final int CL_EXEC_NATIVE_KERNELcl_device_exec_capabilities - bitfield- See Also:
-
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
public static final int CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLEcl_command_queue_properties - bitfield- See Also:
-
CL_QUEUE_PROFILING_ENABLE
public static final int CL_QUEUE_PROFILING_ENABLEcl_command_queue_properties - bitfield- See Also:
-
CL_CONTEXT_REFERENCE_COUNT
public static final int CL_CONTEXT_REFERENCE_COUNTcl_context_info- See Also:
-
CL_CONTEXT_DEVICES
public static final int CL_CONTEXT_DEVICEScl_context_info- See Also:
-
CL_CONTEXT_PROPERTIES
public static final int CL_CONTEXT_PROPERTIEScl_context_info- See Also:
-
CL_CONTEXT_PLATFORM
public static final int CL_CONTEXT_PLATFORMcl_context_info + cl_context_properties- See Also:
-
CL_QUEUE_CONTEXT
public static final int CL_QUEUE_CONTEXTcl_command_queue_info- See Also:
-
CL_QUEUE_DEVICE
public static final int CL_QUEUE_DEVICEcl_command_queue_info- See Also:
-
CL_QUEUE_REFERENCE_COUNT
public static final int CL_QUEUE_REFERENCE_COUNTcl_command_queue_info- See Also:
-
CL_QUEUE_PROPERTIES
public static final int CL_QUEUE_PROPERTIEScl_command_queue_info- See Also:
-
CL_MEM_READ_WRITE
public static final int CL_MEM_READ_WRITEcl_mem_flags - bitfield- See Also:
-
CL_MEM_WRITE_ONLY
public static final int CL_MEM_WRITE_ONLYcl_mem_flags - bitfield- See Also:
-
CL_MEM_READ_ONLY
public static final int CL_MEM_READ_ONLYcl_mem_flags - bitfield- See Also:
-
CL_MEM_USE_HOST_PTR
public static final int CL_MEM_USE_HOST_PTRcl_mem_flags - bitfield- See Also:
-
CL_MEM_ALLOC_HOST_PTR
public static final int CL_MEM_ALLOC_HOST_PTRcl_mem_flags - bitfield- See Also:
-
CL_MEM_COPY_HOST_PTR
public static final int CL_MEM_COPY_HOST_PTRcl_mem_flags - bitfield- See Also:
-
CL_R
public static final int CL_Rcl_channel_order- See Also:
-
CL_A
public static final int CL_Acl_channel_order- See Also:
-
CL_RG
public static final int CL_RGcl_channel_order- See Also:
-
CL_RA
public static final int CL_RAcl_channel_order- See Also:
-
CL_RGB
public static final int CL_RGBcl_channel_order- See Also:
-
CL_RGBA
public static final int CL_RGBAcl_channel_order- See Also:
-
CL_BGRA
public static final int CL_BGRAcl_channel_order- See Also:
-
CL_ARGB
public static final int CL_ARGBcl_channel_order- See Also:
-
CL_INTENSITY
public static final int CL_INTENSITYcl_channel_order- See Also:
-
CL_LUMINANCE
public static final int CL_LUMINANCEcl_channel_order- See Also:
-
CL_SNORM_INT8
public static final int CL_SNORM_INT8cl_channel_type- See Also:
-
CL_SNORM_INT16
public static final int CL_SNORM_INT16cl_channel_type- See Also:
-
CL_UNORM_INT8
public static final int CL_UNORM_INT8cl_channel_type- See Also:
-
CL_UNORM_INT16
public static final int CL_UNORM_INT16cl_channel_type- See Also:
-
CL_UNORM_SHORT_565
public static final int CL_UNORM_SHORT_565cl_channel_type- See Also:
-
CL_UNORM_SHORT_555
public static final int CL_UNORM_SHORT_555cl_channel_type- See Also:
-
CL_UNORM_INT_101010
public static final int CL_UNORM_INT_101010cl_channel_type- See Also:
-
CL_SIGNED_INT8
public static final int CL_SIGNED_INT8cl_channel_type- See Also:
-
CL_SIGNED_INT16
public static final int CL_SIGNED_INT16cl_channel_type- See Also:
-
CL_SIGNED_INT32
public static final int CL_SIGNED_INT32cl_channel_type- See Also:
-
CL_UNSIGNED_INT8
public static final int CL_UNSIGNED_INT8cl_channel_type- See Also:
-
CL_UNSIGNED_INT16
public static final int CL_UNSIGNED_INT16cl_channel_type- See Also:
-
CL_UNSIGNED_INT32
public static final int CL_UNSIGNED_INT32cl_channel_type- See Also:
-
CL_HALF_FLOAT
public static final int CL_HALF_FLOATcl_channel_type- See Also:
-
CL_FLOAT
public static final int CL_FLOATcl_channel_type- See Also:
-
CL_MEM_OBJECT_BUFFER
public static final int CL_MEM_OBJECT_BUFFERcl_mem_object_type- See Also:
-
CL_MEM_OBJECT_IMAGE2D
public static final int CL_MEM_OBJECT_IMAGE2Dcl_mem_object_type- See Also:
-
CL_MEM_OBJECT_IMAGE3D
public static final int CL_MEM_OBJECT_IMAGE3Dcl_mem_object_type- See Also:
-
CL_MEM_TYPE
public static final int CL_MEM_TYPEcl_mem_info- See Also:
-
CL_MEM_FLAGS
public static final int CL_MEM_FLAGScl_mem_info- See Also:
-
CL_MEM_SIZE
public static final int CL_MEM_SIZEcl_mem_info- See Also:
-
CL_MEM_HOST_PTR
public static final int CL_MEM_HOST_PTRcl_mem_info- See Also:
-
CL_MEM_MAP_COUNT
public static final int CL_MEM_MAP_COUNTcl_mem_info- See Also:
-
CL_MEM_REFERENCE_COUNT
public static final int CL_MEM_REFERENCE_COUNTcl_mem_info- See Also:
-
CL_MEM_CONTEXT
public static final int CL_MEM_CONTEXTcl_mem_info- See Also:
-
CL_IMAGE_FORMAT
public static final int CL_IMAGE_FORMATcl_image_info- See Also:
-
CL_IMAGE_ELEMENT_SIZE
public static final int CL_IMAGE_ELEMENT_SIZEcl_image_info- See Also:
-
CL_IMAGE_ROW_PITCH
public static final int CL_IMAGE_ROW_PITCHcl_image_info- See Also:
-
CL_IMAGE_SLICE_PITCH
public static final int CL_IMAGE_SLICE_PITCHcl_image_info- See Also:
-
CL_IMAGE_WIDTH
public static final int CL_IMAGE_WIDTHcl_image_info- See Also:
-
CL_IMAGE_HEIGHT
public static final int CL_IMAGE_HEIGHTcl_image_info- See Also:
-
CL_IMAGE_DEPTH
public static final int CL_IMAGE_DEPTHcl_image_info- See Also:
-
CL_ADDRESS_NONE
public static final int CL_ADDRESS_NONEcl_addressing_mode- See Also:
-
CL_ADDRESS_CLAMP_TO_EDGE
public static final int CL_ADDRESS_CLAMP_TO_EDGEcl_addressing_mode- See Also:
-
CL_ADDRESS_CLAMP
public static final int CL_ADDRESS_CLAMPcl_addressing_mode- See Also:
-
CL_ADDRESS_REPEAT
public static final int CL_ADDRESS_REPEATcl_addressing_mode- See Also:
-
CL_FILTER_NEAREST
public static final int CL_FILTER_NEARESTcl_filter_mode- See Also:
-
CL_FILTER_LINEAR
public static final int CL_FILTER_LINEARcl_filter_mode- See Also:
-
CL_SAMPLER_REFERENCE_COUNT
public static final int CL_SAMPLER_REFERENCE_COUNTcl_sampler_info- See Also:
-
CL_SAMPLER_CONTEXT
public static final int CL_SAMPLER_CONTEXTcl_sampler_info- See Also:
-
CL_SAMPLER_NORMALIZED_COORDS
public static final int CL_SAMPLER_NORMALIZED_COORDScl_sampler_info- See Also:
-
CL_SAMPLER_ADDRESSING_MODE
public static final int CL_SAMPLER_ADDRESSING_MODEcl_sampler_info- See Also:
-
CL_SAMPLER_FILTER_MODE
public static final int CL_SAMPLER_FILTER_MODEcl_sampler_info- See Also:
-
CL_MAP_READ
public static final int CL_MAP_READcl_map_flags - bitfield- See Also:
-
CL_MAP_WRITE
public static final int CL_MAP_WRITEcl_map_flags - bitfield- See Also:
-
CL_PROGRAM_REFERENCE_COUNT
public static final int CL_PROGRAM_REFERENCE_COUNTcl_program_info- See Also:
-
CL_PROGRAM_CONTEXT
public static final int CL_PROGRAM_CONTEXTcl_program_info- See Also:
-
CL_PROGRAM_NUM_DEVICES
public static final int CL_PROGRAM_NUM_DEVICEScl_program_info- See Also:
-
CL_PROGRAM_DEVICES
public static final int CL_PROGRAM_DEVICEScl_program_info- See Also:
-
CL_PROGRAM_SOURCE
public static final int CL_PROGRAM_SOURCEcl_program_info- See Also:
-
CL_PROGRAM_BINARY_SIZES
public static final int CL_PROGRAM_BINARY_SIZEScl_program_info- See Also:
-
CL_PROGRAM_BINARIES
public static final int CL_PROGRAM_BINARIEScl_program_info- See Also:
-
CL_PROGRAM_BUILD_STATUS
public static final int CL_PROGRAM_BUILD_STATUScl_program_build_info- See Also:
-
CL_PROGRAM_BUILD_OPTIONS
public static final int CL_PROGRAM_BUILD_OPTIONScl_program_build_info- See Also:
-
CL_PROGRAM_BUILD_LOG
public static final int CL_PROGRAM_BUILD_LOGcl_program_build_info- See Also:
-
CL_BUILD_SUCCESS
public static final int CL_BUILD_SUCCESScl_build_status- See Also:
-
CL_BUILD_NONE
public static final int CL_BUILD_NONEcl_build_status- See Also:
-
CL_BUILD_ERROR
public static final int CL_BUILD_ERRORcl_build_status- See Also:
-
CL_BUILD_IN_PROGRESS
public static final int CL_BUILD_IN_PROGRESScl_build_status- See Also:
-
CL_KERNEL_FUNCTION_NAME
public static final int CL_KERNEL_FUNCTION_NAMEcl_kernel_info- See Also:
-
CL_KERNEL_NUM_ARGS
public static final int CL_KERNEL_NUM_ARGScl_kernel_info- See Also:
-
CL_KERNEL_REFERENCE_COUNT
public static final int CL_KERNEL_REFERENCE_COUNTcl_kernel_info- See Also:
-
CL_KERNEL_CONTEXT
public static final int CL_KERNEL_CONTEXTcl_kernel_info- See Also:
-
CL_KERNEL_PROGRAM
public static final int CL_KERNEL_PROGRAMcl_kernel_info- See Also:
-
CL_KERNEL_WORK_GROUP_SIZE
public static final int CL_KERNEL_WORK_GROUP_SIZEcl_kernel_work_group_info- See Also:
-
CL_KERNEL_COMPILE_WORK_GROUP_SIZE
public static final int CL_KERNEL_COMPILE_WORK_GROUP_SIZEcl_kernel_work_group_info- See Also:
-
CL_KERNEL_LOCAL_MEM_SIZE
public static final int CL_KERNEL_LOCAL_MEM_SIZEcl_kernel_work_group_info- See Also:
-
CL_EVENT_COMMAND_QUEUE
public static final int CL_EVENT_COMMAND_QUEUEcl_event_info- See Also:
-
CL_EVENT_COMMAND_TYPE
public static final int CL_EVENT_COMMAND_TYPEcl_event_info- See Also:
-
CL_EVENT_REFERENCE_COUNT
public static final int CL_EVENT_REFERENCE_COUNTcl_event_info- See Also:
-
CL_EVENT_COMMAND_EXECUTION_STATUS
public static final int CL_EVENT_COMMAND_EXECUTION_STATUScl_event_info- See Also:
-
CL_COMMAND_NDRANGE_KERNEL
public static final int CL_COMMAND_NDRANGE_KERNELcl_command_type- See Also:
-
CL_COMMAND_TASK
public static final int CL_COMMAND_TASKcl_command_type- See Also:
-
CL_COMMAND_NATIVE_KERNEL
public static final int CL_COMMAND_NATIVE_KERNELcl_command_type- See Also:
-
CL_COMMAND_READ_BUFFER
public static final int CL_COMMAND_READ_BUFFERcl_command_type- See Also:
-
CL_COMMAND_WRITE_BUFFER
public static final int CL_COMMAND_WRITE_BUFFERcl_command_type- See Also:
-
CL_COMMAND_COPY_BUFFER
public static final int CL_COMMAND_COPY_BUFFERcl_command_type- See Also:
-
CL_COMMAND_READ_IMAGE
public static final int CL_COMMAND_READ_IMAGEcl_command_type- See Also:
-
CL_COMMAND_WRITE_IMAGE
public static final int CL_COMMAND_WRITE_IMAGEcl_command_type- See Also:
-
CL_COMMAND_COPY_IMAGE
public static final int CL_COMMAND_COPY_IMAGEcl_command_type- See Also:
-
CL_COMMAND_COPY_IMAGE_TO_BUFFER
public static final int CL_COMMAND_COPY_IMAGE_TO_BUFFERcl_command_type- See Also:
-
CL_COMMAND_COPY_BUFFER_TO_IMAGE
public static final int CL_COMMAND_COPY_BUFFER_TO_IMAGEcl_command_type- See Also:
-
CL_COMMAND_MAP_BUFFER
public static final int CL_COMMAND_MAP_BUFFERcl_command_type- See Also:
-
CL_COMMAND_MAP_IMAGE
public static final int CL_COMMAND_MAP_IMAGEcl_command_type- See Also:
-
CL_COMMAND_UNMAP_MEM_OBJECT
public static final int CL_COMMAND_UNMAP_MEM_OBJECTcl_command_type- See Also:
-
CL_COMMAND_MARKER
public static final int CL_COMMAND_MARKERcl_command_type- See Also:
-
CL_COMMAND_ACQUIRE_GL_OBJECTS
public static final int CL_COMMAND_ACQUIRE_GL_OBJECTScl_command_type- See Also:
-
CL_COMMAND_RELEASE_GL_OBJECTS
public static final int CL_COMMAND_RELEASE_GL_OBJECTScl_command_type- See Also:
-
CL_COMPLETE
public static final int CL_COMPLETEcommand execution status- See Also:
-
CL_RUNNING
public static final int CL_RUNNINGcommand execution status- See Also:
-
CL_SUBMITTED
public static final int CL_SUBMITTEDcommand execution status- See Also:
-
CL_QUEUED
public static final int CL_QUEUEDcommand execution status- See Also:
-
CL_PROFILING_COMMAND_QUEUED
public static final int CL_PROFILING_COMMAND_QUEUEDcl_profiling_info- See Also:
-
CL_PROFILING_COMMAND_SUBMIT
public static final int CL_PROFILING_COMMAND_SUBMITcl_profiling_info- See Also:
-
CL_PROFILING_COMMAND_START
public static final int CL_PROFILING_COMMAND_STARTcl_profiling_info- See Also:
-
CL_PROFILING_COMMAND_END
public static final int CL_PROFILING_COMMAND_ENDcl_profiling_info- See Also:
-
-
Method Details
-
nclGetPlatformIDs
public static int nclGetPlatformIDs(int num_entries, long platforms, long num_platforms) Unsafe version of:GetPlatformIDs
- Parameters:
num_entries
- the number ofcl_platform_id
entries that can be added toplatforms
. Ifplatforms
is notNULL
, thenum_entries
must be greater than zero.
-
clGetPlatformIDs
public static int clGetPlatformIDs(@Nullable PointerBuffer platforms, @Nullable IntBuffer num_platforms) Obtains the list of available platforms.- Parameters:
platforms
- returns a list of OpenCL platforms found. Thecl_platform_id
values returned inplatforms
can be used to identify a specific OpenCL platform. Ifplatforms
argument isNULL
, this argument is ignored. The number of OpenCL platforms returned is the minimum of the value specified bynum_entries
or the number of OpenCL platforms available.num_platforms
- returns the number of OpenCL platforms available. Ifnum_platforms
isNULL
, this argument is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifnum_entries
is equal to zero andplatforms
is notNULL
or if bothnum_platforms
andplatforms
areNULL
.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
nclGetPlatformInfo
public static int nclGetPlatformInfo(long platform, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetPlatformInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetPlatformInfo
public static int clGetPlatformInfo(long platform, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about the specified OpenCL platform.- Parameters:
platform
- the platform to queryparam_name
- the parameter to query. One of:PLATFORM_PROFILE
PLATFORM_VERSION
PLATFORM_NAME
PLATFORM_VENDOR
PLATFORM_EXTENSIONS
PLATFORM_HOST_TIMER_RESOLUTION
param_value
- the memory location where appropriate values for a givenparam_name
will be returnedparam_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_PLATFORM
ifplatform
is not a valid platform.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
clGetPlatformInfo
public static int clGetPlatformInfo(long platform, int param_name, @Nullable LongBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about the specified OpenCL platform.- Parameters:
platform
- the platform to queryparam_name
- the parameter to query. One of:PLATFORM_PROFILE
PLATFORM_VERSION
PLATFORM_NAME
PLATFORM_VENDOR
PLATFORM_EXTENSIONS
PLATFORM_HOST_TIMER_RESOLUTION
param_value
- the memory location where appropriate values for a givenparam_name
will be returnedparam_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_PLATFORM
ifplatform
is not a valid platform.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.OUT_OF_HOST_MEMORY
if there is a failure to allocate resources required by the OpenCL implementation on the host.
- See Also:
-
nclGetDeviceIDs
public static int nclGetDeviceIDs(long platform, long device_type, int num_entries, long devices, long num_devices) Unsafe version of:GetDeviceIDs
- Parameters:
num_entries
- the number ofcl_device_id
entries that can be added to devices. Ifdevices
is notNULL
, thenum_entries
must be greater than zero.
-
clGetDeviceIDs
public static int clGetDeviceIDs(long platform, long device_type, @Nullable PointerBuffer devices, @Nullable IntBuffer num_devices) Obtains the list of devices available on a platform.- Parameters:
platform
- the platform to querydevice_type
- a bitfield that identifies the type of OpenCL device. Thedevice_type
can be used to query specific OpenCL devices or all OpenCL devices available. One or more of:DEVICE_TYPE_DEFAULT
DEVICE_TYPE_CPU
DEVICE_TYPE_GPU
DEVICE_TYPE_ACCELERATOR
DEVICE_TYPE_ALL
DEVICE_TYPE_CUSTOM
devices
- returns a list of OpenCL devices found. Thecl_device_id
values returned indevices
can be used to identify a specific OpenCL device. Ifdevices
argument isNULL
, this argument is ignored. The number of OpenCL devices returned is the minimum of the value specified bynum_entries
or the number of OpenCL devices whose type matchesdevice_type
.num_devices
- returns the number of OpenCL devices available that matchdevice_type
. Ifnum_devices
isNULL
, this argument is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_PLATFORM
ifplatform
is not a valid platform.INVALID_DEVICE_TYPE
ifdevice_type
is not a valid value.INVALID_VALUE
ifnum_entries
is equal to zero anddevices
is notNULL
or if bothnum_devices
anddevices
areNULL
.DEVICE_NOT_FOUND
if no OpenCL devices that matcheddevice_type
were found.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:
-
nclGetDeviceInfo
public static int nclGetDeviceInfo(long device, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetDeviceInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetDeviceInfo
public static int clGetDeviceInfo(long device, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.device
may be a device returned byGetDeviceIDs
or a sub-device created byCreateSubDevices
. Ifdevice
is a sub-device, the specific information for the sub-device will be returned.- Parameters:
device
- the device to queryparam_name
- an enumeration constant tha identifies the device information being queried. One of:param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not valid.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value or ifparam_name
is a value that is available as an extension and the corresponding extension is not supported by the device.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:
-
clGetDeviceInfo
public static int clGetDeviceInfo(long device, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.device
may be a device returned byGetDeviceIDs
or a sub-device created byCreateSubDevices
. Ifdevice
is a sub-device, the specific information for the sub-device will be returned.- Parameters:
device
- the device to queryparam_name
- an enumeration constant tha identifies the device information being queried. One of:param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not valid.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value or ifparam_name
is a value that is available as an extension and the corresponding extension is not supported by the device.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:
-
clGetDeviceInfo
public static int clGetDeviceInfo(long device, int param_name, @Nullable LongBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.device
may be a device returned byGetDeviceIDs
or a sub-device created byCreateSubDevices
. Ifdevice
is a sub-device, the specific information for the sub-device will be returned.- Parameters:
device
- the device to queryparam_name
- an enumeration constant tha identifies the device information being queried. One of:param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not valid.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value or ifparam_name
is a value that is available as an extension and the corresponding extension is not supported by the device.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:
-
clGetDeviceInfo
public static int clGetDeviceInfo(long device, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns specific information about an OpenCL device.device
may be a device returned byGetDeviceIDs
or a sub-device created byCreateSubDevices
. Ifdevice
is a sub-device, the specific information for the sub-device will be returned.- Parameters:
device
- the device to queryparam_name
- an enumeration constant tha identifies the device information being queried. One of:param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not valid.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value or ifparam_name
is a value that is available as an extension and the corresponding extension is not supported by the device.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:
-
nclCreateContext
public static long nclCreateContext(long properties, int num_devices, long devices, long pfn_notify, long user_data, long errcode_ret) Unsafe version of:CreateContext
- Parameters:
num_devices
- the number of devices specified in thedevices
argument
-
clCreateContext
public static long clCreateContext(@Nullable PointerBuffer properties, PointerBuffer devices, @Nullable CLContextCallbackI pfn_notify, long user_data, @Nullable IntBuffer errcode_ret) Creates an OpenCL context. An OpenCL context is created with one or more devices. Contexts are used by the OpenCL runtime for managing objects such as command-queues, memory, program and kernel objects and for executing kernels on one or more devices specified in the context.- Parameters:
properties
- a list of context property names and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. One of:CONTEXT_PLATFORM
CONTEXT_INTEROP_USER_SYNC
GL_CONTEXT_KHR
EGL_DISPLAY_KHR
GLX_DISPLAY_KHR
WGL_HDC_KHR
CGL_SHAREGROUP_KHR
devices
- a list of unique devices returned byGetDeviceIDs
or sub-devices created byCreateSubDevices
for a platformpfn_notify
- a callback function that can be registered by the application. This callback function will be used by the OpenCL implementation to report information on errors during context creation as well as errors that occur at runtime in this context. 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.If
pfn_notify
isNULL
, no callback function is registered.user_data
- will be passed as theuser_data
argument whenpfn_notify
is called.user_data
can beNULL
.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero context and
errcode_ret
is set toSUCCESS
if the context is created successfully. Otherwise, it returns aNULL
value with the following error values returned inerrcode_ret
:INVALID_PLATFORM
ifproperties
isNULL
and no platform could be selected or if platform value specified in properties is not a valid platform.INVALID_PROPERTY
if context property name inproperties
is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.INVALID_VALUE
ifdevices
isNULL
.INVALID_VALUE
ifnum_devices
is equal to zero.INVALID_VALUE
ifpfn_notify
isNULL
butuser_data
is notNULL
.INVALID_DEVICE
ifdevices
contains an invalid device.DEVICE_NOT_AVAILABLE
if a device indevices
is currently not available even though the device was returned byGetDeviceIDs
.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:
-
clCreateContext
public static long clCreateContext(@Nullable PointerBuffer properties, long device, @Nullable CLContextCallbackI pfn_notify, long user_data, @Nullable IntBuffer errcode_ret) Creates an OpenCL context. An OpenCL context is created with one or more devices. Contexts are used by the OpenCL runtime for managing objects such as command-queues, memory, program and kernel objects and for executing kernels on one or more devices specified in the context.- Parameters:
properties
- a list of context property names and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0. One of:CONTEXT_PLATFORM
CONTEXT_INTEROP_USER_SYNC
GL_CONTEXT_KHR
EGL_DISPLAY_KHR
GLX_DISPLAY_KHR
WGL_HDC_KHR
CGL_SHAREGROUP_KHR
pfn_notify
- a callback function that can be registered by the application. This callback function will be used by the OpenCL implementation to report information on errors during context creation as well as errors that occur at runtime in this context. 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.If
pfn_notify
isNULL
, no callback function is registered.user_data
- will be passed as theuser_data
argument whenpfn_notify
is called.user_data
can beNULL
.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero context and
errcode_ret
is set toSUCCESS
if the context is created successfully. Otherwise, it returns aNULL
value with the following error values returned inerrcode_ret
:INVALID_PLATFORM
ifproperties
isNULL
and no platform could be selected or if platform value specified in properties is not a valid platform.INVALID_PROPERTY
if context property name inproperties
is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.INVALID_VALUE
ifdevices
isNULL
.INVALID_VALUE
ifnum_devices
is equal to zero.INVALID_VALUE
ifpfn_notify
isNULL
butuser_data
is notNULL
.INVALID_DEVICE
ifdevices
contains an invalid device.DEVICE_NOT_AVAILABLE
if a device indevices
is currently not available even though the device was returned byGetDeviceIDs
.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:
-
nclCreateContextFromType
public static long nclCreateContextFromType(long properties, long device_type, long pfn_notify, long user_data, long errcode_ret) Unsafe version of:CreateContextFromType
-
clCreateContextFromType
public static long clCreateContextFromType(@Nullable PointerBuffer properties, long device_type, @Nullable CLContextCallbackI pfn_notify, long user_data, @Nullable IntBuffer errcode_ret) Creates a context using devices of the specified type. SeeCreateContext
for details.- Parameters:
properties
- a list of context property names and their corresponding values. Each property name is immediately followed by the corresponding desired value. The list is terminated with 0.device_type
- a bit-field that identifies the type of device. One of:DEVICE_TYPE_DEFAULT
DEVICE_TYPE_CPU
DEVICE_TYPE_GPU
DEVICE_TYPE_ACCELERATOR
DEVICE_TYPE_ALL
DEVICE_TYPE_CUSTOM
pfn_notify
- a callback function that can be registered by the applicationuser_data
- will be passed as theuser_data
argument whenpfn_notify
is called.user_data
can beNULL
.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- See Also:
-
clRetainContext
public static int clRetainContext(long context) Increments the context reference count.CreateContext
andCreateContextFromType
perform an implicit retain. This is very helpful for 3rd party libraries, which typically get a context passed to them by the application. However, it is possible that the application may delete the context without informing the library. Allowing functions to attach to (i.e. retain) and release a context solves the problem of a context being used by a library no longer being valid.- Parameters:
context
- the context to retain- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors: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:
-
clReleaseContext
public static int clReleaseContext(long context) Decrements the context reference count.After the context reference count becomes zero and all the objects attached to context (such as memory objects, command-queues) are released, the context is deleted.
- Parameters:
context
- the context to release- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors: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:
-
nclGetContextInfo
public static int nclGetContextInfo(long context, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetContextInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetContextInfo
public static int clGetContextInfo(long context, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Queries information about a context.- Parameters:
context
- the OpenCL context being queriedparam_name
- an enumeration constant that specifies the information to query. One of:CONTEXT_REFERENCE_COUNT
CONTEXT_DEVICES
CONTEXT_PROPERTIES
CONTEXT_NUM_DEVICES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_CONTEXT
ifcontext
is not a valid context.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.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:
-
clGetContextInfo
public static int clGetContextInfo(long context, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Queries information about a context.- Parameters:
context
- the OpenCL context being queriedparam_name
- an enumeration constant that specifies the information to query. One of:CONTEXT_REFERENCE_COUNT
CONTEXT_DEVICES
CONTEXT_PROPERTIES
CONTEXT_NUM_DEVICES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_CONTEXT
ifcontext
is not a valid context.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.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:
-
clGetContextInfo
public static int clGetContextInfo(long context, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Queries information about a context.- Parameters:
context
- the OpenCL context being queriedparam_name
- an enumeration constant that specifies the information to query. One of:CONTEXT_REFERENCE_COUNT
CONTEXT_DEVICES
CONTEXT_PROPERTIES
CONTEXT_NUM_DEVICES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_CONTEXT
ifcontext
is not a valid context.INVALID_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.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:
-
nclCreateCommandQueue
public static long nclCreateCommandQueue(long context, long device, long properties, long errcode_ret) Unsafe version of:CreateCommandQueue
-
clCreateCommandQueue
public static long clCreateCommandQueue(long context, long device, long properties, @Nullable IntBuffer errcode_ret) Creates a command-queue on a specific device.OpenCL objects such as memory, program and kernel objects are created using a context. Operations on these objects are performed using a command-queue. The command-queue can be used to queue a set of operations (referred to as commands) in order. Having multiple command-queues allows applications to queue multiple independent commands without requiring synchronization. Note that this should work as long as these objects are not being shared. Sharing of objects across multiple command-queues will require the application to perform appropriate synchronization.
- Parameters:
context
- a valid OpenCL contextdevice
- a device associated with context. It can either be in the list of devices specified when context is created usingCreateContext
or have the same device type as device type specified when context is created usingCreateContextFromType
.properties
- a bit-field of properties for the command-queue. One of:QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
QUEUE_PROFILING_ENABLE
QUEUE_ON_DEVICE
QUEUE_ON_DEVICE_DEFAULT
errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero command-queue and
errcode_ret
is set toSUCCESS
if the command-queue 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.INVALID_DEVICE
ifdevice
is not a valid device or is not associated withcontext
.INVALID_VALUE
if values specified inproperties
are not valid.INVALID_QUEUE_PROPERTIES
if values specified inproperties
are valid but are not supported by the device.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:
-
clRetainCommandQueue
public static int clRetainCommandQueue(long command_queue) Increments thecommand_queue
reference count.CreateCommandQueue
performs an implicit retain. This is very helpful for 3rd party libraries, which typically get a command-queue passed to them by the application. However, it is possible that the application may delete the command-queue without informing the library. Allowing functions to attach to (i.e. retain) and release a command-queue solves the problem of a command-queue being used by a library no longer being valid.- Parameters:
command_queue
- the command-queue to retain- 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.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:
-
clReleaseCommandQueue
public static int clReleaseCommandQueue(long command_queue) Decrements thecommand_queue
reference count.After the
command_queue
reference count becomes zero and all commands queued tocommand_queue
have finished (eg. kernel executions, memory object updates etc.), the command-queue is deleted.clReleaseCommandQueue
performs an implicit flush to issue any previously queued OpenCL commands in command_queue.- Parameters:
command_queue
- the command-queue to release- 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.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:
-
nclGetCommandQueueInfo
public static int nclGetCommandQueueInfo(long command_queue, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetCommandQueueInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetCommandQueueInfo
public static int clGetCommandQueueInfo(long command_queue, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Queries information about a command-queue.- Parameters:
command_queue
- the command-queue being queriedparam_name
- the information to query. One of:QUEUE_CONTEXT
QUEUE_DEVICE
QUEUE_REFERENCE_COUNT
QUEUE_PROPERTIES
QUEUE_SIZE
QUEUE_DEVICE_DEFAULT
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- 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_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.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:
-
clGetCommandQueueInfo
public static int clGetCommandQueueInfo(long command_queue, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Queries information about a command-queue.- Parameters:
command_queue
- the command-queue being queriedparam_name
- the information to query. One of:QUEUE_CONTEXT
QUEUE_DEVICE
QUEUE_REFERENCE_COUNT
QUEUE_PROPERTIES
QUEUE_SIZE
QUEUE_DEVICE_DEFAULT
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- 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_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.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:
-
clGetCommandQueueInfo
public static int clGetCommandQueueInfo(long command_queue, int param_name, @Nullable LongBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Queries information about a command-queue.- Parameters:
command_queue
- the command-queue being queriedparam_name
- the information to query. One of:QUEUE_CONTEXT
QUEUE_DEVICE
QUEUE_REFERENCE_COUNT
QUEUE_PROPERTIES
QUEUE_SIZE
QUEUE_DEVICE_DEFAULT
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- 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_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.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:
-
clGetCommandQueueInfo
public static int clGetCommandQueueInfo(long command_queue, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Queries information about a command-queue.- Parameters:
command_queue
- the command-queue being queriedparam_name
- the information to query. One of:QUEUE_CONTEXT
QUEUE_DEVICE
QUEUE_REFERENCE_COUNT
QUEUE_PROPERTIES
QUEUE_SIZE
QUEUE_DEVICE_DEFAULT
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- 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_VALUE
ifparam_name
is not one of the supported values or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is not aNULL
value.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:
-
nclCreateBuffer
public static long nclCreateBuffer(long context, long flags, long size, long host_ptr, long errcode_ret) Unsafe version of:CreateBuffer
- Parameters:
size
- the size in bytes of the buffer memory object to be allocated
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, long size, @Nullable IntBuffer errcode_ret) Creates a buffer object.If
clCreateBuffer
is called withMEM_USE_HOST_PTR
set in itsflags
argument, the contents of the memory pointed to byhost_ptr
at the time of theclCreateBuffer
call define the initial contents of the buffer object.If
clCreateBuffer
is called with a pointer returned bySVMAlloc
as itshost_ptr
argument, andCL_MEM_USE_HOST_PTR
is set in itsflags
argument,clCreateBuffer
will succeed and return a valid non-zero buffer object as long as thesize
argument is no larger than the size argument passed in the originalclSVMAlloc
call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.- Parameters:
context
- a valid OpenCL context used to create the buffer objectflags
- a bit-field that is used to specify allocation and usage information such as the memory area that should be used to allocate the buffer object and how it will be used. If value specified for flags is 0, the default is used which isMEM_READ_WRITE
. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
size
- the size in bytes of the buffer memory object to be allocatederrcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero buffer object and
errcode_ret
is set toSUCCESS
if the buffer 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_BUFFER_SIZE
ifsize
is 0 or ifsize
is greater thanDEVICE_MAX_MEM_ALLOC_SIZE
for all devices in context.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set inflags
or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set inflags
.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for 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:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, ByteBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a buffer object.If
clCreateBuffer
is called withMEM_USE_HOST_PTR
set in itsflags
argument, the contents of the memory pointed to byhost_ptr
at the time of theclCreateBuffer
call define the initial contents of the buffer object.If
clCreateBuffer
is called with a pointer returned bySVMAlloc
as itshost_ptr
argument, andCL_MEM_USE_HOST_PTR
is set in itsflags
argument,clCreateBuffer
will succeed and return a valid non-zero buffer object as long as thesize
argument is no larger than the size argument passed in the originalclSVMAlloc
call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.- Parameters:
context
- a valid OpenCL context used to create the buffer objectflags
- a bit-field that is used to specify allocation and usage information such as the memory area that should be used to allocate the buffer object and how it will be used. If value specified for flags is 0, the default is used which isMEM_READ_WRITE
. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
host_ptr
- a pointer to the buffer data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥size
bytes.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero buffer object and
errcode_ret
is set toSUCCESS
if the buffer 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_BUFFER_SIZE
ifsize
is 0 or ifsize
is greater thanDEVICE_MAX_MEM_ALLOC_SIZE
for all devices in context.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set inflags
or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set inflags
.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for 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:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, ShortBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a buffer object.If
clCreateBuffer
is called withMEM_USE_HOST_PTR
set in itsflags
argument, the contents of the memory pointed to byhost_ptr
at the time of theclCreateBuffer
call define the initial contents of the buffer object.If
clCreateBuffer
is called with a pointer returned bySVMAlloc
as itshost_ptr
argument, andCL_MEM_USE_HOST_PTR
is set in itsflags
argument,clCreateBuffer
will succeed and return a valid non-zero buffer object as long as thesize
argument is no larger than the size argument passed in the originalclSVMAlloc
call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.- Parameters:
context
- a valid OpenCL context used to create the buffer objectflags
- a bit-field that is used to specify allocation and usage information such as the memory area that should be used to allocate the buffer object and how it will be used. If value specified for flags is 0, the default is used which isMEM_READ_WRITE
. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
host_ptr
- a pointer to the buffer data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥size
bytes.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero buffer object and
errcode_ret
is set toSUCCESS
if the buffer 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_BUFFER_SIZE
ifsize
is 0 or ifsize
is greater thanDEVICE_MAX_MEM_ALLOC_SIZE
for all devices in context.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set inflags
or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set inflags
.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for 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:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, IntBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a buffer object.If
clCreateBuffer
is called withMEM_USE_HOST_PTR
set in itsflags
argument, the contents of the memory pointed to byhost_ptr
at the time of theclCreateBuffer
call define the initial contents of the buffer object.If
clCreateBuffer
is called with a pointer returned bySVMAlloc
as itshost_ptr
argument, andCL_MEM_USE_HOST_PTR
is set in itsflags
argument,clCreateBuffer
will succeed and return a valid non-zero buffer object as long as thesize
argument is no larger than the size argument passed in the originalclSVMAlloc
call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.- Parameters:
context
- a valid OpenCL context used to create the buffer objectflags
- a bit-field that is used to specify allocation and usage information such as the memory area that should be used to allocate the buffer object and how it will be used. If value specified for flags is 0, the default is used which isMEM_READ_WRITE
. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
host_ptr
- a pointer to the buffer data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥size
bytes.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero buffer object and
errcode_ret
is set toSUCCESS
if the buffer 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_BUFFER_SIZE
ifsize
is 0 or ifsize
is greater thanDEVICE_MAX_MEM_ALLOC_SIZE
for all devices in context.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set inflags
or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set inflags
.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for 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:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, FloatBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a buffer object.If
clCreateBuffer
is called withMEM_USE_HOST_PTR
set in itsflags
argument, the contents of the memory pointed to byhost_ptr
at the time of theclCreateBuffer
call define the initial contents of the buffer object.If
clCreateBuffer
is called with a pointer returned bySVMAlloc
as itshost_ptr
argument, andCL_MEM_USE_HOST_PTR
is set in itsflags
argument,clCreateBuffer
will succeed and return a valid non-zero buffer object as long as thesize
argument is no larger than the size argument passed in the originalclSVMAlloc
call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.- Parameters:
context
- a valid OpenCL context used to create the buffer objectflags
- a bit-field that is used to specify allocation and usage information such as the memory area that should be used to allocate the buffer object and how it will be used. If value specified for flags is 0, the default is used which isMEM_READ_WRITE
. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
host_ptr
- a pointer to the buffer data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥size
bytes.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero buffer object and
errcode_ret
is set toSUCCESS
if the buffer 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_BUFFER_SIZE
ifsize
is 0 or ifsize
is greater thanDEVICE_MAX_MEM_ALLOC_SIZE
for all devices in context.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set inflags
or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set inflags
.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for 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:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, DoubleBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a buffer object.If
clCreateBuffer
is called withMEM_USE_HOST_PTR
set in itsflags
argument, the contents of the memory pointed to byhost_ptr
at the time of theclCreateBuffer
call define the initial contents of the buffer object.If
clCreateBuffer
is called with a pointer returned bySVMAlloc
as itshost_ptr
argument, andCL_MEM_USE_HOST_PTR
is set in itsflags
argument,clCreateBuffer
will succeed and return a valid non-zero buffer object as long as thesize
argument is no larger than the size argument passed in the originalclSVMAlloc
call. The new buffer object returned has the shared memory as the underlying storage. Locations in the buffers underlying shared memory can be operated on using atomic operations to the devices level of support as defined in the memory model.- Parameters:
context
- a valid OpenCL context used to create the buffer objectflags
- a bit-field that is used to specify allocation and usage information such as the memory area that should be used to allocate the buffer object and how it will be used. If value specified for flags is 0, the default is used which isMEM_READ_WRITE
. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
host_ptr
- a pointer to the buffer data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥size
bytes.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero buffer object and
errcode_ret
is set toSUCCESS
if the buffer 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_BUFFER_SIZE
ifsize
is 0 or ifsize
is greater thanDEVICE_MAX_MEM_ALLOC_SIZE
for all devices in context.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set inflags
or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set inflags
.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for 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:
-
nclEnqueueReadBuffer
public static int nclEnqueueReadBuffer(long command_queue, long buffer, int blocking_read, long offset, long size, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueReadBuffer
- Parameters:
size
- the size in bytes of data being readnum_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, ByteBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from a buffer object to host memory.Calling
clEnqueueReadBuffer
to read a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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 non-blockingIf
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBuffer
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,clEnqueueReadBuffer
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.offset
- the offset in bytes in the buffer object to read fromptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueReadBuffer
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:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, ShortBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from a buffer object to host memory.Calling
clEnqueueReadBuffer
to read a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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 non-blockingIf
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBuffer
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,clEnqueueReadBuffer
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.offset
- the offset in bytes in the buffer object to read fromptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueReadBuffer
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:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, IntBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from a buffer object to host memory.Calling
clEnqueueReadBuffer
to read a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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 non-blockingIf
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBuffer
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,clEnqueueReadBuffer
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.offset
- the offset in bytes in the buffer object to read fromptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueReadBuffer
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:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, FloatBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from a buffer object to host memory.Calling
clEnqueueReadBuffer
to read a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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 non-blockingIf
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBuffer
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,clEnqueueReadBuffer
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.offset
- the offset in bytes in the buffer object to read fromptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueReadBuffer
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:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, DoubleBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from a buffer object to host memory.Calling
clEnqueueReadBuffer
to read a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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 non-blockingIf
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadBuffer
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,clEnqueueReadBuffer
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.offset
- the offset in bytes in the buffer object to read fromptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueReadBuffer
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:
-
nclEnqueueWriteBuffer
public static int nclEnqueueWriteBuffer(long command_queue, long buffer, int blocking_write, long offset, long size, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueWriteBuffer
- Parameters:
size
- the size in bytes of data being writtennum_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, ByteBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to a buffer object from host memory.Calling
clEnqueueWriteBuffer
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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
(host_ptr + offset, cb)
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 non-blockingIf
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 theclEnqueueWriteBuffer
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a nonblocking 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.offset
- the offset in bytes in the buffer object to write toptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueWriteBuffer
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
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, ShortBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to a buffer object from host memory.Calling
clEnqueueWriteBuffer
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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
(host_ptr + offset, cb)
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 non-blockingIf
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 theclEnqueueWriteBuffer
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a nonblocking 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.offset
- the offset in bytes in the buffer object to write toptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueWriteBuffer
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
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, IntBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to a buffer object from host memory.Calling
clEnqueueWriteBuffer
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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
(host_ptr + offset, cb)
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 non-blockingIf
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 theclEnqueueWriteBuffer
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a nonblocking 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.offset
- the offset in bytes in the buffer object to write toptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueWriteBuffer
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
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, FloatBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to a buffer object from host memory.Calling
clEnqueueWriteBuffer
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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
(host_ptr + offset, cb)
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 non-blockingIf
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 theclEnqueueWriteBuffer
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a nonblocking 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.offset
- the offset in bytes in the buffer object to write toptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueWriteBuffer
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
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, DoubleBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to a buffer object from host memory.Calling
clEnqueueWriteBuffer
to update the latest bits in a region of the buffer object with theptr
argument value set tohost_ptr + offset
, 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
(host_ptr + offset, cb)
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 non-blockingIf
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 theclEnqueueWriteBuffer
call returns.If
blocking_write
isFALSE
, the OpenCL implementation will useptr
to perform a nonblocking 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.offset
- the offset in bytes in the buffer object to write toptr
- 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(offset, size)
is out of bounds or ifptr
is aNULL
value or ifsize
is 0.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 with buffer.INVALID_OPERATION
ifclEnqueueWriteBuffer
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
-
nclEnqueueCopyBuffer
public static int nclEnqueueCopyBuffer(long command_queue, long src_buffer, long dst_buffer, long src_offset, long dst_offset, long size, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyBuffer
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueCopyBuffer
public static int clEnqueueCopyBuffer(long command_queue, long src_buffer, long dst_buffer, long src_offset, long dst_offset, long size, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to copy a buffer object identified bysrc_buffer
to another buffer object identified bydst_buffer
.- 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_offset
- the offset where to begin copying data fromsrc_buffer
.dst_offset
- the offset where to begin copying data intodst_buffer
size
- the size in bytes to copyevent_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
ifsrc_offset
,dst_offset
,size
,src_offset + size
ordst_offset + size
require accessing elements outside thesrc_buffer
anddst_buffer
buffer objects respectively.INVALID_VALUE
ifsize
is 0.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
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_COPY_OVERLAP
ifsrc_buffer
anddst_buffer
are the same buffer or sub-buffer 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. The regions overlap ifsrc_offset ≤ dst_offset ≤ src_offset + size – 1
or ifdst_offset ≤ src_offset ≤ dst_offset + size – 1
.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:
-
nclEnqueueMapBuffer
public static long nclEnqueueMapBuffer(long command_queue, long buffer, int blocking_map, long map_flags, long offset, long size, int num_events_in_wait_list, long event_wait_list, long event, long errcode_ret) Unsafe version of:EnqueueMapBuffer
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueMapBuffer
@Nullable public static ByteBuffer clEnqueueMapBuffer(long command_queue, long buffer, boolean blocking_map, long map_flags, long offset, long size, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event, @Nullable IntBuffer errcode_ret, @Nullable ByteBuffer old_buffer) Enqueues a command to map a region of the buffer object given by buffer into the host address space and returns a pointer to this mapped region.The pointer returned maps a region starting at
offset
and is at leastsize
bytes in size. The result of a memory access outside this region is undefined.If the buffer object is created with
MEM_USE_HOST_PTR
set inmem_flags
, the following will be true:- The
host_ptr
specified inCreateBuffer
is guaranteed to contain the latest bits in the region being mapped when theclEnqueueMapBuffer
command has completed. - The pointer value returned by
clEnqueueMapBuffer
will be derived from thehost_ptr
specified when the buffer object is created.
Mapped buffer objects are unmapped using
EnqueueUnmapMemObject
.- Parameters:
command_queue
- a valid command-queuebuffer
- a valid buffer object. The OpenCL context associated with command_queue and buffer must be the same.blocking_map
- indicates if the map operation is blocking or non-blocking.If
blocking_map
isTRUE
,clEnqueueMapBuffer
does not return until the specified region in buffer is mapped into the host address space and the application can access the contents of the mapped region using the pointer returned byclEnqueueMapBuffer
.If
blocking_map
isFALSE
i.e. map operation is non-blocking, the pointer to the mapped region returned byclEnqueueMapBuffer
cannot be used until the map command has completed. Theevent
argument returns an event object which can be used to query the execution status of the map command. When the map command is completed, the application can access the contents of the mapped region using the pointer returned byclEnqueueMapBuffer
.map_flags
- a bit-field. One of:MAP_READ
MAP_WRITE
MAP_WRITE_INVALIDATE_REGION
offset
- the offset in bytes of the region in the buffer object that is being mappedsize
- the size in bytes of the region in the buffer object that is being mappedevent_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.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a pointer to the mapped region. The
errcode_ret
is set toSUCCESS
. ANULL
pointer is returned otherwise with one of the following error values returned inerrcode_ret
:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if 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 region being mapped given by(offset, size)
is out of bounds or ifsize
is 0 or if values specified inmap_flags
are not valid.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.MAP_FAILURE
if there is a failure to map the requested region into the host address space. This error cannot occur for buffer objects created withMEM_USE_HOST_PTR
orMEM_ALLOC_HOST_PTR
.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the map 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
if buffer has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
andMAP_READ
is set inmap_flags
or ifbuffer
has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
andMAP_WRITE
orMAP_WRITE_INVALIDATE_REGION
is set inmap_flags
.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
-
nclCreateImage2D
public static long nclCreateImage2D(long context, long flags, long image_format, long image_width, long image_height, long image_row_pitch, long host_ptr, long errcode_ret) Unsafe version of:CreateImage2D
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable ByteBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 2D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_row_pitch * image_height
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent scanlines. Each scanline is stored as a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
orimage_height
are 0 or if they exceed values specified inDEVICE_IMAGE2D_MAX_WIDTH
orDEVICE_IMAGE2D_MAX_HEIGHT
respectively for all devices incontext
or if values specified byimage_row_pitch
do not follow rules described in the argument description.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable ShortBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 2D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_row_pitch * image_height
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent scanlines. Each scanline is stored as a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
orimage_height
are 0 or if they exceed values specified inDEVICE_IMAGE2D_MAX_WIDTH
orDEVICE_IMAGE2D_MAX_HEIGHT
respectively for all devices incontext
or if values specified byimage_row_pitch
do not follow rules described in the argument description.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable IntBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 2D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_row_pitch * image_height
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent scanlines. Each scanline is stored as a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
orimage_height
are 0 or if they exceed values specified inDEVICE_IMAGE2D_MAX_WIDTH
orDEVICE_IMAGE2D_MAX_HEIGHT
respectively for all devices incontext
or if values specified byimage_row_pitch
do not follow rules described in the argument description.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable FloatBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 2D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_row_pitch * image_height
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent scanlines. Each scanline is stored as a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
orimage_height
are 0 or if they exceed values specified inDEVICE_IMAGE2D_MAX_WIDTH
orDEVICE_IMAGE2D_MAX_HEIGHT
respectively for all devices incontext
or if values specified byimage_row_pitch
do not follow rules described in the argument description.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
nclCreateImage3D
public static long nclCreateImage3D(long context, long flags, long image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, long host_ptr, long errcode_ret) Unsafe version of:CreateImage3D
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable ByteBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 3D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_depth
- the depth of the image in pixels. This must be a value > 1.image_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.image_slice_pitch
- the size in bytes of each 2D slice in the 3D image. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_row_pitch * image_height
ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_slice_pitch = 0
,image_slice_pitch
is calculated asimage_row_pitch * image_height
. Ifimage_slice_pitch
is not 0, it must be a multiple of theimage_row_pitch
.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_slice_pitch * image_depth
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent 2D slices. Each 2D slice is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
,image_height
are 0 or ifimage_depth
≤ 1 or if they exceed values specified inDEVICE_IMAGE3D_MAX_WIDTH
,DEVICE_IMAGE3D_MAX_HEIGHT
orDEVICE_IMAGE3D_MAX_DEPTH
respectively for all devices incontext
or if values specified byimage_row_pitch
andimage_slice_pitch
do not follow rules described in the argument descriptions.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable ShortBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 3D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_depth
- the depth of the image in pixels. This must be a value > 1.image_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.image_slice_pitch
- the size in bytes of each 2D slice in the 3D image. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_row_pitch * image_height
ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_slice_pitch = 0
,image_slice_pitch
is calculated asimage_row_pitch * image_height
. Ifimage_slice_pitch
is not 0, it must be a multiple of theimage_row_pitch
.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_slice_pitch * image_depth
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent 2D slices. Each 2D slice is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
,image_height
are 0 or ifimage_depth
≤ 1 or if they exceed values specified inDEVICE_IMAGE3D_MAX_WIDTH
,DEVICE_IMAGE3D_MAX_HEIGHT
orDEVICE_IMAGE3D_MAX_DEPTH
respectively for all devices incontext
or if values specified byimage_row_pitch
andimage_slice_pitch
do not follow rules described in the argument descriptions.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable IntBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 3D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_depth
- the depth of the image in pixels. This must be a value > 1.image_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.image_slice_pitch
- the size in bytes of each 2D slice in the 3D image. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_row_pitch * image_height
ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_slice_pitch = 0
,image_slice_pitch
is calculated asimage_row_pitch * image_height
. Ifimage_slice_pitch
is not 0, it must be a multiple of theimage_row_pitch
.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_slice_pitch * image_depth
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent 2D slices. Each 2D slice is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
,image_height
are 0 or ifimage_depth
≤ 1 or if they exceed values specified inDEVICE_IMAGE3D_MAX_WIDTH
,DEVICE_IMAGE3D_MAX_HEIGHT
orDEVICE_IMAGE3D_MAX_DEPTH
respectively for all devices incontext
or if values specified byimage_row_pitch
andimage_slice_pitch
do not follow rules described in the argument descriptions.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable FloatBuffer host_ptr, @Nullable IntBuffer errcode_ret) Creates a 3D image object.- Parameters:
context
- a valid OpenCL context on which the image object is to be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_format
- a pointer to aCLImageFormat
structure that describes format properties of the image to be allocatedimage_width
- the width of the image in pixelsimage_height
- the height of the image in pixelsimage_depth
- the depth of the image in pixels. This must be a value > 1.image_row_pitch
- the scan-line pitch in bytes. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_width * size
of element in bytes ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_row_pitch
= 0,image_row_pitch
is calculated asimage_width * size of element
in bytes. Ifimage_row_pitch
is not 0, it must be a multiple of the image element size in bytes.image_slice_pitch
- the size in bytes of each 2D slice in the 3D image. This must be 0 ifhost_ptr
isNULL
and can be either 0 or ≥image_row_pitch * image_height
ifhost_ptr
is notNULL
. Ifhost_ptr
is notNULL
andimage_slice_pitch = 0
,image_slice_pitch
is calculated asimage_row_pitch * image_height
. Ifimage_slice_pitch
is not 0, it must be a multiple of theimage_row_pitch
.host_ptr
- a pointer to the image data that may already be allocated by the application. The size of the buffer thathost_ptr
points to must be ≥image_slice_pitch * image_depth
. The size of each element in bytes must be a power of 2. The image data specified byhost_ptr
is stored as a linear sequence of adjacent 2D slices. Each 2D slice is a linear sequence of adjacent scanlines. Each scanline is a linear sequence of image elements.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero image object and
errcode_ret
is set toSUCCESS
if the image 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.INVALID_VALUE
if values specified inflags
are not valid.INVALID_IMAGE_FORMAT_DESCRIPTOR
if values specified inimage_format
are not valid or ifimage_format
isNULL
.INVALID_IMAGE_SIZE
ifimage_width
,image_height
are 0 or ifimage_depth
≤ 1 or if they exceed values specified inDEVICE_IMAGE3D_MAX_WIDTH
,DEVICE_IMAGE3D_MAX_HEIGHT
orDEVICE_IMAGE3D_MAX_DEPTH
respectively for all devices incontext
or if values specified byimage_row_pitch
andimage_slice_pitch
do not follow rules described in the argument descriptions.INVALID_HOST_PTR
ifhost_ptr
isNULL
andMEM_USE_HOST_PTR
orMEM_COPY_HOST_PTR
are set in flags or ifhost_ptr
is notNULL
butMEM_COPY_HOST_PTR
orMEM_USE_HOST_PTR
are not set in flags.IMAGE_FORMAT_NOT_SUPPORTED
if theimage_format
is not supported.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for image object.INVALID_OPERATION
if there are no devices incontext
that support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
nclGetSupportedImageFormats
public static int nclGetSupportedImageFormats(long context, long flags, int image_type, int num_entries, long image_formats, long num_image_formats) Unsafe version of:GetSupportedImageFormats
- Parameters:
num_entries
- the number of entries that can be returned in the memory location given byimage_formats
-
clGetSupportedImageFormats
public static int clGetSupportedImageFormats(long context, long flags, int image_type, @Nullable CLImageFormat.Buffer image_formats, @Nullable IntBuffer num_image_formats) Can be used to get the list of image formats supported by an OpenCL implementation when the following information about an image memory object is specified:- Context
- Image type – 1D, 2D, or 3D image, 1D image buffer, 1D or 2D image array
- Image object allocation information
clGetSupportedImageFormats
returns a union of image formats supported by all devices in the context.- Parameters:
context
- a valid OpenCL context on which the image object(s) will be createdflags
- a bit-field that is used to specify allocation and usage information about the image memory object being created. One of:MEM_READ_WRITE
MEM_WRITE_ONLY
MEM_READ_ONLY
MEM_USE_HOST_PTR
MEM_ALLOC_HOST_PTR
MEM_COPY_HOST_PTR
MEM_HOST_WRITE_ONLY
MEM_HOST_READ_ONLY
MEM_HOST_NO_ACCESS
image_type
- the image type. One of:MEM_OBJECT_IMAGE1D
MEM_OBJECT_IMAGE1D_BUFFER
MEM_OBJECT_BUFFER
MEM_OBJECT_IMAGE2D
MEM_OBJECT_IMAGE3D
MEM_OBJECT_IMAGE1D_ARRAY
MEM_OBJECT_IMAGE2D_ARRAY
MEM_OBJECT_PIPE
image_formats
- a pointer to a memory location where the list of supported image formats are returned. Each entry describes aCLImageFormat
structure supported by the OpenCL implementation. Ifimage_formats
isNULL
, it is ignored.num_image_formats
- the actual number of supported image formats for a specific context and values specified byflags
. Ifnum_image_formats
isNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_CONTEXT
ifcontext
is not a valid context.INVALID_VALUE
ifflags
orimage_type
are not valid, or ifnum_entries
is 0 andimage_formats
is notNULL
.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:
-
nclEnqueueReadImage
public static int nclEnqueueReadImage(long command_queue, long image, int blocking_read, long origin, long region, long row_pitch, long slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueReadImage
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, ByteBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.Calling
clEnqueueReadImage
to read a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this image object have finished execution before the read command begins execution.
- The row_pitch and slice_pitch argument values in clEnqueueReadImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_read
- indicates if the read operation is blocking or non-blocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadImage
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,clEnqueueReadImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifrow_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being read. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal torow_pitch * height
. Ifslice_pitch
is set to 0, the appropriate slice pitch is calculated based on therow_pitch * height
.ptr
- the pointer to a buffer in host memory where image data is to be read toevent_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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being read specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, ShortBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.Calling
clEnqueueReadImage
to read a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this image object have finished execution before the read command begins execution.
- The row_pitch and slice_pitch argument values in clEnqueueReadImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_read
- indicates if the read operation is blocking or non-blocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadImage
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,clEnqueueReadImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifrow_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being read. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal torow_pitch * height
. Ifslice_pitch
is set to 0, the appropriate slice pitch is calculated based on therow_pitch * height
.ptr
- the pointer to a buffer in host memory where image data is to be read toevent_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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being read specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, IntBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.Calling
clEnqueueReadImage
to read a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this image object have finished execution before the read command begins execution.
- The row_pitch and slice_pitch argument values in clEnqueueReadImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_read
- indicates if the read operation is blocking or non-blocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadImage
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,clEnqueueReadImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifrow_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being read. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal torow_pitch * height
. Ifslice_pitch
is set to 0, the appropriate slice pitch is calculated based on therow_pitch * height
.ptr
- the pointer to a buffer in host memory where image data is to be read toevent_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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being read specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, FloatBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.Calling
clEnqueueReadImage
to read a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this image object have finished execution before the read command begins execution.
- The row_pitch and slice_pitch argument values in clEnqueueReadImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_read
- indicates if the read operation is blocking or non-blocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadImage
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,clEnqueueReadImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifrow_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being read. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal torow_pitch * height
. Ifslice_pitch
is set to 0, the appropriate slice pitch is calculated based on therow_pitch * height
.ptr
- the pointer to a buffer in host memory where image data is to be read toevent_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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being read specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, DoubleBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to read from an image or image array object to host memory.Calling
clEnqueueReadImage
to read a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being read is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- All commands that use this image object have finished execution before the read command begins execution.
- The row_pitch and slice_pitch argument values in clEnqueueReadImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_read
- indicates if the read operation is blocking or non-blocking.If
blocking_read
isTRUE
i.e. the read command is blocking,clEnqueueReadImage
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,clEnqueueReadImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifrow_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being read. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal torow_pitch * height
. Ifslice_pitch
is set to 0, the appropriate slice pitch is calculated based on therow_pitch * height
.ptr
- the pointer to a buffer in host memory where image data is to be read toevent_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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being read specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
nclEnqueueWriteImage
public static int nclEnqueueWriteImage(long command_queue, long image, int blocking_write, long origin, long region, long input_row_pitch, long input_slice_pitch, long ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueWriteImage
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, ByteBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.Calling
clEnqueueWriteImage
to update the latest bits in a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region being written contains the latest bits when the enqueued write command begins execution.
- The input_row_pitch and input_slice_pitch argument values in clEnqueueWriteImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_write
- indicates if the read operation is blocking or non-blocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write command in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.input_row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifinput_row_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.input_slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being written. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal toinput_row_pitch * height
. Ifinput_slice_pitch
is set to 0, the appropriate slice pitch is calculated based on theinput_row_pitch * height
.ptr
- the pointer to a buffer in host memory where image 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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being written specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, ShortBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.Calling
clEnqueueWriteImage
to update the latest bits in a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region being written contains the latest bits when the enqueued write command begins execution.
- The input_row_pitch and input_slice_pitch argument values in clEnqueueWriteImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_write
- indicates if the read operation is blocking or non-blocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write command in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.input_row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifinput_row_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.input_slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being written. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal toinput_row_pitch * height
. Ifinput_slice_pitch
is set to 0, the appropriate slice pitch is calculated based on theinput_row_pitch * height
.ptr
- the pointer to a buffer in host memory where image 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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being written specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, IntBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.Calling
clEnqueueWriteImage
to update the latest bits in a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region being written contains the latest bits when the enqueued write command begins execution.
- The input_row_pitch and input_slice_pitch argument values in clEnqueueWriteImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_write
- indicates if the read operation is blocking or non-blocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write command in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.input_row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifinput_row_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.input_slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being written. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal toinput_row_pitch * height
. Ifinput_slice_pitch
is set to 0, the appropriate slice pitch is calculated based on theinput_row_pitch * height
.ptr
- the pointer to a buffer in host memory where image 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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being written specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, FloatBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.Calling
clEnqueueWriteImage
to update the latest bits in a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region being written contains the latest bits when the enqueued write command begins execution.
- The input_row_pitch and input_slice_pitch argument values in clEnqueueWriteImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_write
- indicates if the read operation is blocking or non-blocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write command in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.input_row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifinput_row_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.input_slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being written. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal toinput_row_pitch * height
. Ifinput_slice_pitch
is set to 0, the appropriate slice pitch is calculated based on theinput_row_pitch * height
.ptr
- the pointer to a buffer in host memory where image 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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being written specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, DoubleBuffer ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to write to an image or image array object from host memory.Calling
clEnqueueWriteImage
to update the latest bits in a region of the image with theptr
argument value set tohost_ptr + (origin[2] * image slice pitch + origin[1] * image row pitch + origin[0] * bytes per pixel)
, wherehost_ptr
is a pointer to the memory region specified when the image being written is created withMEM_USE_HOST_PTR
, must meet the following requirements in order to avoid undefined behavior:- The host memory region being written contains the latest bits when the enqueued write command begins execution.
- The input_row_pitch and input_slice_pitch argument values in clEnqueueWriteImage must be set to the image row pitch and slice pitch.
- The image object is not mapped.
- The image object is 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
andimage
must be created with the same OpenCL context.image
- a valid image or image array objectblocking_write
- indicates if the read operation is blocking or non-blocking.If
blocking_write
isTRUE
, the OpenCL implementation copies the data referred to byptr
and enqueues the write command in the command-queue. The memory pointed to byptr
can be reused by the application after theclEnqueueWriteImage
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.origin
- defines the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- defines the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.input_row_pitch
- the length of each row in bytes. This value must be greater than or equal to theelement size in bytes * width
. Ifinput_row_pitch
is set to 0, the appropriate row pitch is calculated based on the size of each element in bytes multiplied bywidth
.input_slice_pitch
- the size in bytes of the 2D slice of the 3D region of a 3D image or each image of a 1D or 2D image array being written. This must be 0 ifimage
is a 1D or 2D image. This value must be greater than or equal toinput_row_pitch * height
. Ifinput_slice_pitch
is set to 0, the appropriate slice pitch is calculated based on theinput_row_pitch * height
.ptr
- the pointer to a buffer in host memory where image 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
andimage
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if the region being written specified byorigin
andregion
is out of bounds or ifptr
is aNULL
value.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifclEnqueueReadImage
is called on image which has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
.INVALID_OPERATION
ifclEnqueueWriteImage
is called on image which has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
.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.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:
-
nclEnqueueCopyImage
public static int nclEnqueueCopyImage(long command_queue, long src_image, long dst_image, long src_origin, long dst_origin, long region, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyImage
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueCopyImage
public static int clEnqueueCopyImage(long command_queue, long src_image, long dst_image, PointerBuffer src_origin, PointerBuffer dst_origin, PointerBuffer region, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to copy image objects.src_image
anddst_image
can be 1D, 2D, 3D image or a 1D, 2D image array objects allowing us to perform the following actions:- Copy a 1D image object to a 1D image object.
- Copy a 1D image object to a scanline of a 2D image object and vice-versa.
- Copy a 1D image object to a scanline of a 2D slice of a 3D image object and vice-versa.
- Copy a 1D image object to a scanline of a specific image index of a 1D or 2D image array object and vice-versa.
- Copy a 2D image object to a 2D image object.
- Copy a 2D image object to a 2D slice of a 3D image object and vice-versa.
- Copy a 2D image object to a specific image index of a 2D image array object and vice-versa.
- Copy images from a 1D image array object to a 1D image array object.
- Copy images from a 2D image array object to a 2D image array object.
- Copy a 3D image object to a 3D image object.
- Parameters:
command_queue
- the command-queue in which the copy command will be queued. The OpenCL context associated withcommand_queue
,src_image
anddst_image
must be the same.src_origin
- the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifsrc_image
is a 2D image object,src_origin[2]
must be 0. Ifsrc_image
is a 1D image object,src_origin[1]
andsrc_origin[2]
must be 0. Ifsrc_image
is a 1D image array object,src_origin[2]
must be 0. Ifsrc_image
is a 1D image array object,src_origin[1]
describes the image index in the 1D image array. Ifsrc_image
is a 2D image array object,src_origin[2]
describes the image index in the 2D image array.dst_origin
- the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifdst_image
is a 2D image object,dst_origin[2]
must be 0. Ifdst_image
is a 1D image or 1D image buffer object,dst_origin[1]
anddst_origin[2]
must be 0. Ifdst_image
is a 1D image array object,dst_origin[2]
must be 0. Ifdst_image
is a 1D image array object,dst_origin[1]
describes the image index in the 1D image array. Ifdst_image
is a 2D image array object,dst_origin[2]
describes the image index in the 2D image array.region
- the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifsrc_image
ordst_image
is a 2D image object,region[2]
must be 1. Ifsrc_image
ordst_image
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifsrc_image
ordst_image
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.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_image
anddst_image
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifsrc_image
anddst_image
are not valid image objects.IMAGE_FORMAT_MISMATCH
ifsrc_image
anddst_image
do not use the same image format.INVALID_VALUE
if the 2D or 3D rectangular region specified bysrc_origin
andsrc_origin + region
refers to a region outsidesrc_image
, or if the 2D or 3D rectangular region specified bydst_origin
anddst_origin + region
refers to a region outsidedst_image
.INVALID_VALUE
if values insrc_origin
,dst_origin
andregion
do not follow rules described in the argument description forsrc_origin
,dst_origin
andregion
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forsrc_image
ordst_image
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forsrc_image
ordst_image
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withsrc_image
ordst_image
.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.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).MEM_COPY_OVERLAP
ifsrc_image
anddst_image
are the same image object and the source and destination regions overlap.
- See Also:
-
nclEnqueueCopyImageToBuffer
public static int nclEnqueueCopyImageToBuffer(long command_queue, long src_image, long dst_buffer, long src_origin, long region, long dst_offset, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyImageToBuffer
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueCopyImageToBuffer
public static int clEnqueueCopyImageToBuffer(long command_queue, long src_image, long dst_buffer, PointerBuffer src_origin, PointerBuffer region, long dst_offset, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to copy an image object to a buffer object.- Parameters:
command_queue
- a valid command-queue. The OpenCL context associated withcommand_queue
,src_image
anddst_buffer
must be the same.src_image
- a valid image objectdst_buffer
- a valid buffer objectsrc_origin
- the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifsrc_image
is a 2D image object,src_origin[2]
must be 0. Ifsrc_image
is a 1D image object,src_origin[1]
andsrc_origin[2]
must be 0. Ifsrc_image
is a 1D image array object,src_origin[2]
must be 0. Ifsrc_image
is a 1D image array object,src_origin[1]
describes the image index in the 1D image array. Ifsrc_image
is a 2D image array object,src_origin[2]
describes the image index in the 2D image array.region
- the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifsrc_image
is a 2D image object,region[2]
must be 1. Ifsrc_image
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifsrc_image
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.dst_offset
- the offset where to begin copying data intodst_buffer
. The size in bytes of the region to be copied referred to asdst_cb
is computed aswidth * height * depth * bytes/image element
ifsrc_image
is a 3D image object, is computed aswidth * height * bytes/image element
ifsrc_image
is a 2D image, is computed aswidth * height * arraysize * bytes/image element
ifsrc_image
is a 2D image array object, is computed aswidth * bytes/image element
ifsrc_image
is a 1D image or 1D image buffer object and is computed aswidth * arraysize * bytes/image element
ifsrc_image
is a 1D image array object.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_image
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_image
is not a valid image object ordst_buffer
is not a valid buffer object or ifsrc_image
is a 1D image buffer object created fromdst_buffer
.INVALID_VALUE
if the 1D, 2D or 3D rectangular region specified bysrc_origin
andsrc_origin + region
refers to a region outsidesrc_image
, or if the region specified bydst_offset
anddst_offset + dst_cb
to a region outsidedst_buffer
.INVALID_VALUE
if values insrc_origin
and region do not follow rules described in the argument description forsrc_origin
andregion
.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
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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forsrc_image
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forsrc_image
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withsrc_image
ordst_buffer
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
nclEnqueueCopyBufferToImage
public static int nclEnqueueCopyBufferToImage(long command_queue, long src_buffer, long dst_image, long src_offset, long dst_origin, long region, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueCopyBufferToImage
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueCopyBufferToImage
public static int clEnqueueCopyBufferToImage(long command_queue, long src_buffer, long dst_image, long src_offset, PointerBuffer dst_origin, PointerBuffer region, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to copy a buffer object to an image object.- Parameters:
command_queue
- a valid command-queue. The OpenCL context associated withcommand_queue
,src_buffer
anddst_image
must be the same.src_buffer
- a valid buffer objectdst_image
- a valid image objectsrc_offset
- the offset where to begin copying data fromsrc_buffer
dst_origin
- the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifdst_image
is a 2D image object,dst_origin[2]
must be 0. Ifdst_image
is a 1D image or 1D image buffer object,dst_origin[1]
anddst_origin[2]
must be 0. Ifdst_image
is a 1D image array object,dst_origin[2]
must be 0. Ifdst_image
is a 1D image array object,dst_origin[1]
describes the image index in the 1D image array. Ifdst_image
is a 2D image array object,dst_origin[2]
describes the image index in the 2D image array.region
- the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifdst_image
is a 2D image object,region[2]
must be 1. Ifdst_image
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifdst_image
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.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_image
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
is not a valid buffer object ordst_image
is not a valid image object or ifdst_image
is a 1D image buffer object created fromsrc_buffer
.INVALID_VALUE
if the 1D, 2D or 3D rectangular region specified bydst_origin
anddst_origin + region
refer to a region outsidedst_image
, or if the region specified bysrc_offset
andsrc_offset + src_cb refer
to a region outsidesrc_buffer
.INVALID_VALUE
if values indst_origin
andregion
do not follow rules described in the argument description fordst_origin
andregion
.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
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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) fordst_image
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) fordst_image
are not supported by device associated with queue.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated withsrc_buffer
ordst_image
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
nclEnqueueMapImage
public static long nclEnqueueMapImage(long command_queue, long image, int blocking_map, long map_flags, long origin, long region, long image_row_pitch, long image_slice_pitch, int num_events_in_wait_list, long event_wait_list, long event, long errcode_ret) Unsafe version of:EnqueueMapImage
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueMapImage
@Nullable public static ByteBuffer clEnqueueMapImage(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, @Nullable PointerBuffer image_slice_pitch, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event, @Nullable IntBuffer errcode_ret, @Nullable ByteBuffer old_buffer) Enqueues a command to map a region in the image object given byimage
into the host address space and returns a pointer to this mapped region.The pointer returned maps a 1D, 2D or 3D region starting at
origin
and is at leastregion[0]
pixels in size for a 1D image, 1D image buffer or 1D image array,(image_row_pitch * region[1])
pixels in size for a 2D image or 2D image array, and(image_slice_pitch * region[2])
pixels in size for a 3D image. The result of a memory access outside this region is undefined.If the image object is created with
MEM_USE_HOST_PTR
set inmem_flags
, the following will be true:- The
host_ptr
specified inCreateImage
is guaranteed to contain the latest bits in the region being mapped when theclEnqueueMapImage
command has completed. - The pointer value returned by
clEnqueueMapImage
will be derived from thehost_ptr
specified when the image object is created.
Mapped image objects are unmapped using
EnqueueUnmapMemObject
.- Parameters:
command_queue
- a valid command-queueimage
- a valid image object. The OpenCL context associated withcommand_queue
andimage
must be the same.blocking_map
- indicates if the map operation is blocking or non-blocking.If
blocking_map
isTRUE
,clEnqueueMapImage
does not return until the specified region in image is mapped into the host address space and the application can access the contents of the mapped region using the pointer returned byclEnqueueMapImage
.If
blocking_map
isFALSE
i.e. map operation is non-blocking, the pointer to the mapped region returned byclEnqueueMapImage
cannot be used until the map command has completed. Theevent
argument returns an event object which can be used to query the execution status of the map command. When the map command is completed, the application can access the contents of the mapped region using the pointer returned byclEnqueueMapImage
.map_flags
- a bit-field. One of:MAP_READ
MAP_WRITE
MAP_WRITE_INVALIDATE_REGION
origin
- the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.image_row_pitch
- the scan-line pitch in bytes for the mapped region. This must be a non-NULL
value.image_slice_pitch
- returns the size in bytes of each 2D slice of a 3D image or the size of each 1D or 2D image in a 1D or 2D image array for the mapped region. For a 1D and 2D image, zero is returned if this argument is notNULL
. For a 3D image, 1D and 2D image array,image_slice_pitch
must be a non-NULL
value.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.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a pointer to the mapped region. The
errcode_ret
is set toSUCCESS
. ANULL
pointer is returned otherwise with one of the following error values returned inerrcode_ret
:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if context associated withcommand_queue
and image are not the same or if context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if region being mapped given by(origin, origin+region)
is out of bounds or if values specified inmap_flags
are not valid.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.INVALID_VALUE
ifimage_row_pitch
isNULL
.INVALID_VALUE
ifimage
is a 3D image, 1D or 2D image array object andimage_slice_pitch
isNULL
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MAP_FAILURE
if there is a failure to map the requested region into the host address space. This error cannot occur for image objects created withMEM_USE_HOST_PTR
orMEM_ALLOC_HOST_PTR
.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the map 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 withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifimage
has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
andMAP_READ
is set inmap_flags
or if image has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
andMAP_WRITE
orMAP_WRITE_INVALIDATE_REGION
is set inmap_flags
.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
-
clEnqueueMapImage
@Nullable public static ByteBuffer clEnqueueMapImage(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, @Nullable PointerBuffer image_slice_pitch, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event, @Nullable IntBuffer errcode_ret, long length, @Nullable ByteBuffer old_buffer) Enqueues a command to map a region in the image object given byimage
into the host address space and returns a pointer to this mapped region.The pointer returned maps a 1D, 2D or 3D region starting at
origin
and is at leastregion[0]
pixels in size for a 1D image, 1D image buffer or 1D image array,(image_row_pitch * region[1])
pixels in size for a 2D image or 2D image array, and(image_slice_pitch * region[2])
pixels in size for a 3D image. The result of a memory access outside this region is undefined.If the image object is created with
MEM_USE_HOST_PTR
set inmem_flags
, the following will be true:- The
host_ptr
specified inCreateImage
is guaranteed to contain the latest bits in the region being mapped when theclEnqueueMapImage
command has completed. - The pointer value returned by
clEnqueueMapImage
will be derived from thehost_ptr
specified when the image object is created.
Mapped image objects are unmapped using
EnqueueUnmapMemObject
.- Parameters:
command_queue
- a valid command-queueimage
- a valid image object. The OpenCL context associated withcommand_queue
andimage
must be the same.blocking_map
- indicates if the map operation is blocking or non-blocking.If
blocking_map
isTRUE
,clEnqueueMapImage
does not return until the specified region in image is mapped into the host address space and the application can access the contents of the mapped region using the pointer returned byclEnqueueMapImage
.If
blocking_map
isFALSE
i.e. map operation is non-blocking, the pointer to the mapped region returned byclEnqueueMapImage
cannot be used until the map command has completed. Theevent
argument returns an event object which can be used to query the execution status of the map command. When the map command is completed, the application can access the contents of the mapped region using the pointer returned byclEnqueueMapImage
.map_flags
- a bit-field. One of:MAP_READ
MAP_WRITE
MAP_WRITE_INVALIDATE_REGION
origin
- the(x, y, z)
offset in pixels in the 1D, 2D or 3D image, the(x, y)
offset and the image index in the 2D image array or the(x)
offset and the image index in the 1D image array. Ifimage
is a 2D image object,origin[2]
must be 0. Ifimage
is a 1D image or 1D image buffer object,origin[1]
andorigin[2]
must be 0. Ifimage
is a 1D image array object,origin[2]
must be 0. Ifimage
is a 1D image array object,origin[1]
describes the image index in the 1D image array. Ifimage
is a 2D image array object,origin[2]
describes the image index in the 2D image array.region
- the(width, height, depth)
in pixels of the 1D, 2D or 3D rectangle, the(width, height)
in pixels of the 2D rectangle and the number of images of a 2D image array or the(width)
in pixels of the 1D rectangle and the number of images of a 1D image array. Ifimage
is a 2D image object,region[2]
must be 1. Ifimage
is a 1D image or 1D image buffer object,region[1]
andregion[2]
must be 1. Ifimage
is a 1D image array object,region[2]
must be 1. The values inregion
cannot be 0.image_row_pitch
- the scan-line pitch in bytes for the mapped region. This must be a non-NULL
value.image_slice_pitch
- returns the size in bytes of each 2D slice of a 3D image or the size of each 1D or 2D image in a 1D or 2D image array for the mapped region. For a 1D and 2D image, zero is returned if this argument is notNULL
. For a 3D image, 1D and 2D image array,image_slice_pitch
must be a non-NULL
value.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.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a pointer to the mapped region. The
errcode_ret
is set toSUCCESS
. ANULL
pointer is returned otherwise with one of the following error values returned inerrcode_ret
:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if context associated withcommand_queue
and image are not the same or if context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_MEM_OBJECT
ifimage
is not a valid image object.INVALID_VALUE
if region being mapped given by(origin, origin+region)
is out of bounds or if values specified inmap_flags
are not valid.INVALID_VALUE
if values inorigin
andregion
do not follow rules described in the argument description fororigin
andregion
.INVALID_VALUE
ifimage_row_pitch
isNULL
.INVALID_VALUE
ifimage
is a 3D image, 1D or 2D image array object andimage_slice_pitch
isNULL
.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.INVALID_IMAGE_SIZE
if image dimensions (image width, height, specified or compute row and/or slice pitch) forimage
are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if image format (image channel order and data type) forimage
are not supported by device associated with queue.MAP_FAILURE
if there is a failure to map the requested region into the host address space. This error cannot occur for image objects created withMEM_USE_HOST_PTR
orMEM_ALLOC_HOST_PTR
.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the map 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 withimage
.INVALID_OPERATION
if the device associated withcommand_queue
does not support images (i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).INVALID_OPERATION
ifimage
has been created withMEM_HOST_WRITE_ONLY
orMEM_HOST_NO_ACCESS
andMAP_READ
is set inmap_flags
or if image has been created withMEM_HOST_READ_ONLY
orMEM_HOST_NO_ACCESS
andMAP_WRITE
orMAP_WRITE_INVALIDATE_REGION
is set inmap_flags
.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
-
nclGetImageInfo
public static int nclGetImageInfo(long image, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetImageInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetImageInfo
public static int clGetImageInfo(long image, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information specific to an image object.- Parameters:
image
- the image object being queriedparam_name
- the information to query. One of:IMAGE_FORMAT
IMAGE_ELEMENT_SIZE
IMAGE_ROW_PITCH
IMAGE_SLICE_PITCH
IMAGE_WIDTH
IMAGE_HEIGHT
IMAGE_DEPTH
IMAGE_ARRAY_SIZE
IMAGE_BUFFER
IMAGE_NUM_MIP_LEVELS
IMAGE_NUM_SAMPLES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_MEM_OBJECT
ifimage
is a not a valid image 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:
-
clGetImageInfo
public static int clGetImageInfo(long image, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information specific to an image object.- Parameters:
image
- the image object being queriedparam_name
- the information to query. One of:IMAGE_FORMAT
IMAGE_ELEMENT_SIZE
IMAGE_ROW_PITCH
IMAGE_SLICE_PITCH
IMAGE_WIDTH
IMAGE_HEIGHT
IMAGE_DEPTH
IMAGE_ARRAY_SIZE
IMAGE_BUFFER
IMAGE_NUM_MIP_LEVELS
IMAGE_NUM_SAMPLES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_MEM_OBJECT
ifimage
is a not a valid image 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:
-
clGetImageInfo
public static int clGetImageInfo(long image, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information specific to an image object.- Parameters:
image
- the image object being queriedparam_name
- the information to query. One of:IMAGE_FORMAT
IMAGE_ELEMENT_SIZE
IMAGE_ROW_PITCH
IMAGE_SLICE_PITCH
IMAGE_WIDTH
IMAGE_HEIGHT
IMAGE_DEPTH
IMAGE_ARRAY_SIZE
IMAGE_BUFFER
IMAGE_NUM_MIP_LEVELS
IMAGE_NUM_SAMPLES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_MEM_OBJECT
ifimage
is a not a valid image 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:
-
clRetainMemObject
public static int clRetainMemObject(long memobj) Increments thememobj
reference count.CreateBuffer
,CreateSubBuffer
andCreateImage
perform an implicit retain.- Parameters:
memobj
- the memory object to retain- 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 (buffer or image 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:
-
clReleaseMemObject
public static int clReleaseMemObject(long memobj) Decrements thememobj
reference count.After the
memobj
reference count becomes zero and commands queued for execution on a command-queue(s) that usememobj
have finished, the memory object is deleted. Ifmemobj
is a buffer object,memobj
cannot be deleted until all sub-buffer objects associated withmemobj
are deleted.- Parameters:
memobj
- the memory object to release- 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.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:
-
nclEnqueueUnmapMemObject
public static int nclEnqueueUnmapMemObject(long command_queue, long memobj, long mapped_ptr, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueUnmapMemObject
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueUnmapMemObject
public static int clEnqueueUnmapMemObject(long command_queue, long memobj, ByteBuffer mapped_ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to unmap a previously mapped region of a memory object. Reads or writes from the host using the pointer returned byEnqueueMapBuffer
orEnqueueMapImage
are considered to be complete.EnqueueMapBuffer
, andEnqueueMapImage
increments the mapped count of the memory object. The initial mapped count value of the memory object is zero. Multiple calls toEnqueueMapBuffer
, orEnqueueMapImage
on the same memory object will increment this mapped count by appropriate number of calls.clEnqueueUnmapMemObject
decrements the mapped count of the memory object.EnqueueMapBuffer
, andEnqueueMapImage
act as synchronization points for a region of the buffer object being mapped.- Parameters:
command_queue
- a valid command-queuememobj
- a valid memory object. The OpenCL context associated withcommand_queue
andmemobj
must be the same.mapped_ptr
- the host address returned by a previous call toEnqueueMapBuffer
, orEnqueueMapImage
formemobj
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_MEM_OBJECT
ifmemobj
is not a valid memory object.INVALID_VALUE
ifmapped_ptr
is not a valid pointer returned byEnqueueMapBuffer
, orEnqueueMapImage
formemobj
.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.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.INVALID_CONTEXT
if context associated withcommand_queue
andmemobj
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.
- See Also:
-
nclGetMemObjectInfo
public static int nclGetMemObjectInfo(long memobj, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetMemObjectInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetMemObjectInfo
public static int clGetMemObjectInfo(long memobj, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).- Parameters:
memobj
- the memory object being queriedparam_name
- the information to query. One of:MEM_TYPE
MEM_FLAGS
MEM_SIZE
MEM_HOST_PTR
MEM_MAP_COUNT
MEM_REFERENCE_COUNT
MEM_CONTEXT
MEM_ASSOCIATED_MEMOBJECT
MEM_OFFSET
MEM_USES_SVM_POINTER
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_MEM_OBJECT
ifmemobj
is a not a valid memory 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:
-
clGetMemObjectInfo
public static int clGetMemObjectInfo(long memobj, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).- Parameters:
memobj
- the memory object being queriedparam_name
- the information to query. One of:MEM_TYPE
MEM_FLAGS
MEM_SIZE
MEM_HOST_PTR
MEM_MAP_COUNT
MEM_REFERENCE_COUNT
MEM_CONTEXT
MEM_ASSOCIATED_MEMOBJECT
MEM_OFFSET
MEM_USES_SVM_POINTER
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_MEM_OBJECT
ifmemobj
is a not a valid memory 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:
-
clGetMemObjectInfo
public static int clGetMemObjectInfo(long memobj, int param_name, @Nullable LongBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).- Parameters:
memobj
- the memory object being queriedparam_name
- the information to query. One of:MEM_TYPE
MEM_FLAGS
MEM_SIZE
MEM_HOST_PTR
MEM_MAP_COUNT
MEM_REFERENCE_COUNT
MEM_CONTEXT
MEM_ASSOCIATED_MEMOBJECT
MEM_OFFSET
MEM_USES_SVM_POINTER
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_MEM_OBJECT
ifmemobj
is a not a valid memory 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:
-
clGetMemObjectInfo
public static int clGetMemObjectInfo(long memobj, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information that is common to all memory objects (buffer and image objects).- Parameters:
memobj
- the memory object being queriedparam_name
- the information to query. One of:MEM_TYPE
MEM_FLAGS
MEM_SIZE
MEM_HOST_PTR
MEM_MAP_COUNT
MEM_REFERENCE_COUNT
MEM_CONTEXT
MEM_ASSOCIATED_MEMOBJECT
MEM_OFFSET
MEM_USES_SVM_POINTER
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_MEM_OBJECT
ifmemobj
is a not a valid memory 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:
-
nclCreateSampler
public static long nclCreateSampler(long context, int normalized_coords, int addressing_mode, int filter_mode, long errcode_ret) Unsafe version of:CreateSampler
-
clCreateSampler
public static long clCreateSampler(long context, boolean normalized_coords, int addressing_mode, int filter_mode, @Nullable IntBuffer errcode_ret) Creates a sampler object.A sampler object describes how to sample an image when the image is read in the kernel. The built-in functions to read from an image in a kernel take a sampler as an argument. The sampler arguments to the image read function can be sampler objects created using OpenCL functions and passed as argument values to the kernel or can be samplers declared inside a kernel.
- Parameters:
context
- a valid OpenCL contextnormalized_coords
- determines if the image coordinates specified are normalized or notaddressing_mode
- specifies how out-of-range image coordinates are handled when reading from an image. One of:ADDRESS_NONE
ADDRESS_CLAMP_TO_EDGE
ADDRESS_CLAMP
ADDRESS_REPEAT
ADDRESS_MIRRORED_REPEAT
filter_mode
- the type of filter that must be applied when reading an image. One of:FILTER_NEAREST
FILTER_LINEAR
errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero sampler object and
errcode_ret
is set toSUCCESS
if the sampler 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.INVALID_VALUE
ifaddressing_mode
,filter_mode
ornormalized_coords
or combination of these argument values are not valid.INVALID_OPERATION
if images are not supported by any device associated withcontext
(i.e.DEVICE_IMAGE_SUPPORT
isFALSE
).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:
-
clRetainSampler
public static int clRetainSampler(long sampler) Increments the sampler reference count.CreateSampler
performs an implicit retain.- Parameters:
sampler
- the sample object to retain- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_SAMPLER
if sampler is not a valid sampler 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:
-
clReleaseSampler
public static int clReleaseSampler(long sampler) Decrements the sampler reference count. The sampler object is deleted after the reference count becomes zero and commands queued for execution on a command-queue(s) that use sampler have finished.- Parameters:
sampler
- the sample object to release- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_SAMPLER
ifsampler
is not a valid sampler 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:
-
nclGetSamplerInfo
public static int nclGetSamplerInfo(long sampler, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetSamplerInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetSamplerInfo
public static int clGetSamplerInfo(long sampler, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a sampler object.- Parameters:
sampler
- the sampler being queriedparam_name
- the information to query. One of:SAMPLER_REFERENCE_COUNT
SAMPLER_CONTEXT
SAMPLER_NORMALIZED_COORDS
SAMPLER_ADDRESSING_MODE
SAMPLER_FILTER_MODE
SAMPLER_MIP_FILTER_MODE
SAMPLER_LOD_MIN
SAMPLER_LOD_MAX
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_SAMPLER
ifsampler
is a not a valid sampler 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:
-
clGetSamplerInfo
public static int clGetSamplerInfo(long sampler, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a sampler object.- Parameters:
sampler
- the sampler being queriedparam_name
- the information to query. One of:SAMPLER_REFERENCE_COUNT
SAMPLER_CONTEXT
SAMPLER_NORMALIZED_COORDS
SAMPLER_ADDRESSING_MODE
SAMPLER_FILTER_MODE
SAMPLER_MIP_FILTER_MODE
SAMPLER_LOD_MIN
SAMPLER_LOD_MAX
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_SAMPLER
ifsampler
is a not a valid sampler 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:
-
clGetSamplerInfo
public static int clGetSamplerInfo(long sampler, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a sampler object.- Parameters:
sampler
- the sampler being queriedparam_name
- the information to query. One of:SAMPLER_REFERENCE_COUNT
SAMPLER_CONTEXT
SAMPLER_NORMALIZED_COORDS
SAMPLER_ADDRESSING_MODE
SAMPLER_FILTER_MODE
SAMPLER_MIP_FILTER_MODE
SAMPLER_LOD_MIN
SAMPLER_LOD_MAX
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_SAMPLER
ifsampler
is a not a valid sampler 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:
-
nclCreateProgramWithSource
public static long nclCreateProgramWithSource(long context, int count, long strings, long lengths, long errcode_ret) Unsafe version of:CreateProgramWithSource
- Parameters:
count
- the number of elements in thestrings
andlengths
arrays
-
clCreateProgramWithSource
public static long clCreateProgramWithSource(long context, PointerBuffer strings, @Nullable PointerBuffer lengths, @Nullable IntBuffer errcode_ret) Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object. The devices associated with the program object are the devices associated withcontext
. The source code specified by strings is either an OpenCL C program source, header or implementation-defined source for custom devices that support an online compiler.- Parameters:
context
- a valid OpenCL contextstrings
- an array ofcount
pointers to optionally null-terminated character strings that make up the source codelengths
- an array with the number of chars in each string (the string length). If an element inlengths
is zero, its accompanying string is null-terminated. Iflengths
isNULL
, all strings in thestrings
argument are considered null-terminated. Any length value passed in that is greater than zero excludes the null terminator in its count.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero program object and
errcode_ret
is set toSUCCESS
if the program 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.INVALID_VALUE
ifcount
is zero or ifstrings
or any entry instrings
isNULL
.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:
-
clCreateProgramWithSource
public static long clCreateProgramWithSource(long context, CharSequence[] strings, @Nullable IntBuffer errcode_ret) Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object. The devices associated with the program object are the devices associated withcontext
. The source code specified by strings is either an OpenCL C program source, header or implementation-defined source for custom devices that support an online compiler.- Parameters:
context
- a valid OpenCL contextstrings
- an array ofcount
pointers to optionally null-terminated character strings that make up the source codeerrcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero program object and
errcode_ret
is set toSUCCESS
if the program 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.INVALID_VALUE
ifcount
is zero or ifstrings
or any entry instrings
isNULL
.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:
-
clCreateProgramWithSource
public static long clCreateProgramWithSource(long context, CharSequence string, @Nullable IntBuffer errcode_ret) Creates a program object for a context, and loads the source code specified by the text strings in the strings array into the program object. The devices associated with the program object are the devices associated withcontext
. The source code specified by strings is either an OpenCL C program source, header or implementation-defined source for custom devices that support an online compiler.- 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 program object and
errcode_ret
is set toSUCCESS
if the program 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.INVALID_VALUE
ifcount
is zero or ifstrings
or any entry instrings
isNULL
.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:
-
nclCreateProgramWithBinary
public static long nclCreateProgramWithBinary(long context, int num_devices, long device_list, long lengths, long binaries, long binary_status, long errcode_ret) Unsafe version of:CreateProgramWithBinary
- Parameters:
num_devices
- the number of devices listed indevice_list
-
clCreateProgramWithBinary
public static long clCreateProgramWithBinary(long context, PointerBuffer device_list, PointerBuffer lengths, PointerBuffer binaries, @Nullable IntBuffer binary_status, @Nullable IntBuffer errcode_ret) Creates a program object for a context, and loads the binary bits specified bybinary
into the program object.The program binaries specified by
binaries
contain the bits that describe one of the following:- a program executable to be run on the device(s) associated with
context
, - a compiled program for device(s) associated with
context
, or - a library of compiled programs for device(s) associated with
context
.
The program binary can consist of either or both:
- Device-specific code and/or,
- Implementation-specific intermediate representation (IR) which will be converted to the device-specific code.
OpenCL allows applications to create a program object using the program source or binary and build appropriate program executables. This can be very useful as it allows applications to load program source and then compile and link to generate a program executable online on its first instance for appropriate OpenCL devices in the system. These executables can now be queried and cached by the application. Future instances of the application launching will no longer need to compile and link the program executables. The cached executables can be read and loaded by the application, which can help significantly reduce the application initialization time.
- Parameters:
context
- a valid OpenCL contextdevice_list
- a pointer to a list of devices that are incontext
. device_list must be a non-NULL
value. The binaries are loaded for devices specified in this list.lengths
- an array of the size in bytes of the program binaries to be loaded for devices specified bydevice_list
.binaries
- an array of pointers to program binaries to be loaded for devices specified bydevice_list
. For each device given bydevice_list[i]
, the pointer to the program binary for that device is given bybinaries[i]
and the length of this corresponding binary is given bylengths[i]
.lengths[i]
cannot be zero andbinaries[i]
cannot be aNULL
pointer.binary_status
- returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array ofnum_devices
entries and returnsSUCCESS
inbinary_status[i]
if binary was successfully loaded for device specified bydevice_list[i]
; otherwise returnsINVALID_VALUE
iflengths[i]
is zero or ifbinaries[i]
is aNULL
value orINVALID_BINARY
inbinary_status[i]
if program binary is not a valid binary for the specified device. Ifbinary_status
isNULL
, it is ignored.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero program object and
errcode_ret
is set toSUCCESS
if the program 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.INVALID_VALUE
ifdevice_list
isNULL
ornum_devices
is zero.INVALID_DEVICE
if OpenCL devices listed indevice_list
are not in the list of devices associated withcontext
.INVALID_VALUE
iflengths
orbinaries
areNULL
or if any entry inlengths[i]
is zero orbinaries[i]
isNULL
.INVALID_BINARY
if an invalid program binary was encountered for any device.binary_status
will return specific status for each device.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:
- a program executable to be run on the device(s) associated with
-
clCreateProgramWithBinary
public static long clCreateProgramWithBinary(long context, PointerBuffer device_list, ByteBuffer[] binaries, @Nullable IntBuffer binary_status, @Nullable IntBuffer errcode_ret) Creates a program object for a context, and loads the binary bits specified bybinary
into the program object.The program binaries specified by
binaries
contain the bits that describe one of the following:- a program executable to be run on the device(s) associated with
context
, - a compiled program for device(s) associated with
context
, or - a library of compiled programs for device(s) associated with
context
.
The program binary can consist of either or both:
- Device-specific code and/or,
- Implementation-specific intermediate representation (IR) which will be converted to the device-specific code.
OpenCL allows applications to create a program object using the program source or binary and build appropriate program executables. This can be very useful as it allows applications to load program source and then compile and link to generate a program executable online on its first instance for appropriate OpenCL devices in the system. These executables can now be queried and cached by the application. Future instances of the application launching will no longer need to compile and link the program executables. The cached executables can be read and loaded by the application, which can help significantly reduce the application initialization time.
- Parameters:
context
- a valid OpenCL contextdevice_list
- a pointer to a list of devices that are incontext
. device_list must be a non-NULL
value. The binaries are loaded for devices specified in this list.binaries
- an array of pointers to program binaries to be loaded for devices specified bydevice_list
. For each device given bydevice_list[i]
, the pointer to the program binary for that device is given bybinaries[i]
and the length of this corresponding binary is given bylengths[i]
.lengths[i]
cannot be zero andbinaries[i]
cannot be aNULL
pointer.binary_status
- returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array ofnum_devices
entries and returnsSUCCESS
inbinary_status[i]
if binary was successfully loaded for device specified bydevice_list[i]
; otherwise returnsINVALID_VALUE
iflengths[i]
is zero or ifbinaries[i]
is aNULL
value orINVALID_BINARY
inbinary_status[i]
if program binary is not a valid binary for the specified device. Ifbinary_status
isNULL
, it is ignored.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero program object and
errcode_ret
is set toSUCCESS
if the program 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.INVALID_VALUE
ifdevice_list
isNULL
ornum_devices
is zero.INVALID_DEVICE
if OpenCL devices listed indevice_list
are not in the list of devices associated withcontext
.INVALID_VALUE
iflengths
orbinaries
areNULL
or if any entry inlengths[i]
is zero orbinaries[i]
isNULL
.INVALID_BINARY
if an invalid program binary was encountered for any device.binary_status
will return specific status for each device.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:
- a program executable to be run on the device(s) associated with
-
clCreateProgramWithBinary
public static long clCreateProgramWithBinary(long context, PointerBuffer device_list, ByteBuffer binary, @Nullable IntBuffer binary_status, @Nullable IntBuffer errcode_ret) Creates a program object for a context, and loads the binary bits specified bybinary
into the program object.The program binaries specified by
binaries
contain the bits that describe one of the following:- a program executable to be run on the device(s) associated with
context
, - a compiled program for device(s) associated with
context
, or - a library of compiled programs for device(s) associated with
context
.
The program binary can consist of either or both:
- Device-specific code and/or,
- Implementation-specific intermediate representation (IR) which will be converted to the device-specific code.
OpenCL allows applications to create a program object using the program source or binary and build appropriate program executables. This can be very useful as it allows applications to load program source and then compile and link to generate a program executable online on its first instance for appropriate OpenCL devices in the system. These executables can now be queried and cached by the application. Future instances of the application launching will no longer need to compile and link the program executables. The cached executables can be read and loaded by the application, which can help significantly reduce the application initialization time.
- Parameters:
context
- a valid OpenCL contextdevice_list
- a pointer to a list of devices that are incontext
. device_list must be a non-NULL
value. The binaries are loaded for devices specified in this list.binary_status
- returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array ofnum_devices
entries and returnsSUCCESS
inbinary_status[i]
if binary was successfully loaded for device specified bydevice_list[i]
; otherwise returnsINVALID_VALUE
iflengths[i]
is zero or ifbinaries[i]
is aNULL
value orINVALID_BINARY
inbinary_status[i]
if program binary is not a valid binary for the specified device. Ifbinary_status
isNULL
, it is ignored.errcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero program object and
errcode_ret
is set toSUCCESS
if the program 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.INVALID_VALUE
ifdevice_list
isNULL
ornum_devices
is zero.INVALID_DEVICE
if OpenCL devices listed indevice_list
are not in the list of devices associated withcontext
.INVALID_VALUE
iflengths
orbinaries
areNULL
or if any entry inlengths[i]
is zero orbinaries[i]
isNULL
.INVALID_BINARY
if an invalid program binary was encountered for any device.binary_status
will return specific status for each device.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:
- a program executable to be run on the device(s) associated with
-
clRetainProgram
public static int clRetainProgram(long program) Increments theprogram
reference count.clCreateProgram
does an implicit retain.- Parameters:
program
- the program object to retain- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_PROGRAM
ifprogram
is not a valid program 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:
-
clReleaseProgram
public static int clReleaseProgram(long program) Decrements theprogram
reference count. The program object is deleted after all kernel objects associated with program have been deleted and the program reference count becomes zero.- Parameters:
program
- the program object to release- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_PROGRAM
ifprogram
is not a valid program 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:
-
nclBuildProgram
public static int nclBuildProgram(long program, int num_devices, long device_list, long options, long pfn_notify, long user_data) Unsafe version of:BuildProgram
- Parameters:
num_devices
- the number of devices listed indevice_list
-
clBuildProgram
public static int clBuildProgram(long program, @Nullable PointerBuffer device_list, ByteBuffer options, @Nullable CLProgramCallbackI pfn_notify, long user_data) Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated withprogram
. OpenCL allows program executables to be built using the source or the binary.clBuildProgram
must be called forprogram
created using eitherCreateProgramWithSource
orCreateProgramWithBinary
to build the program executable for one or more devices associated withprogram
. Ifprogram
is created withCreateProgramWithBinary
, then the program binary must be an executable binary (not a compiled binary or library).The executable binary can be queried using
GetProgramInfo
and can be specified toCreateProgramWithBinary
to create a new program object.- Parameters:
program
- the program objectdevice_list
- a pointer to a list of devices associated withprogram
. Ifdevice_list
is aNULL
value, the program executable is built for all devices associated withprogram
for which a source or binary has been loaded. Ifdevice_list
is a non-NULL
value, the program executable is built for devices specified in this list for which a source or binary has been loaded.options
- a pointer to a null-terminated string of characters that describes the build options to be used for building the program executablepfn_notify
- a function pointer to a notification routine. The notification routine is a callback function that an application can register and which will be called when the program executable has been built (successfully or unsuccessfully). Ifpfn_notify
is notNULL
,clBuildProgram
does not need to wait for the build to complete and can return immediately once the build operation can begin. The build operation can begin if the context, program whose sources are being compiled and linked, list of devices and build options specified are all valid and appropriate host and device resources needed to perform the build are available. Ifpfn_notify
isNULL
,clBuildProgram
does not return until the build has completed. 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 an 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_PROGRAM
ifprogram
is not a valid program object.INVALID_VALUE
ifdevice_list
isNULL
andnum_devices
is > 0, or ifdevice_list
is notNULL
andnum_devices
is 0.INVALID_VALUE
ifpfn_notify
isNULL
butuser_data
is notNULL
.INVALID_DEVICE
if OpenCL devices listed indevice_list
are not in the list of devices associated with program.INVALID_BINARY
ifprogram
is created withCreateProgramWithBinary
and devices listed indevice_list
do not have a valid program binary loaded.INVALID_BUILD_OPTIONS
if the build options specified byoptions
are invalid.INVALID_OPERATION
if the build of a program executable for any of the devices listed indevice_list
by a previous call toclBuildProgram
forprogram
has not completed.COMPILER_NOT_AVAILABLE
ifprogram
is created withCreateProgramWithSource
and a compiler is not available i.e.DEVICE_COMPILER_AVAILABLE
is set toFALSE
.BUILD_PROGRAM_FAILURE
if there is a failure to build the program executable. This error will be returned ifclBuildProgram
does not return until the build has completed.INVALID_OPERATION
if there are kernel objects attached toprogram
.INVALID_OPERATION
if program was not created withCreateProgramWithSource
orCreateProgramWithBinary
.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:
-
clBuildProgram
public static int clBuildProgram(long program, @Nullable PointerBuffer device_list, CharSequence options, @Nullable CLProgramCallbackI pfn_notify, long user_data) Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated withprogram
. OpenCL allows program executables to be built using the source or the binary.clBuildProgram
must be called forprogram
created using eitherCreateProgramWithSource
orCreateProgramWithBinary
to build the program executable for one or more devices associated withprogram
. Ifprogram
is created withCreateProgramWithBinary
, then the program binary must be an executable binary (not a compiled binary or library).The executable binary can be queried using
GetProgramInfo
and can be specified toCreateProgramWithBinary
to create a new program object.- Parameters:
program
- the program objectdevice_list
- a pointer to a list of devices associated withprogram
. Ifdevice_list
is aNULL
value, the program executable is built for all devices associated withprogram
for which a source or binary has been loaded. Ifdevice_list
is a non-NULL
value, the program executable is built for devices specified in this list for which a source or binary has been loaded.options
- a pointer to a null-terminated string of characters that describes the build options to be used for building the program executablepfn_notify
- a function pointer to a notification routine. The notification routine is a callback function that an application can register and which will be called when the program executable has been built (successfully or unsuccessfully). Ifpfn_notify
is notNULL
,clBuildProgram
does not need to wait for the build to complete and can return immediately once the build operation can begin. The build operation can begin if the context, program whose sources are being compiled and linked, list of devices and build options specified are all valid and appropriate host and device resources needed to perform the build are available. Ifpfn_notify
isNULL
,clBuildProgram
does not return until the build has completed. 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 an 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_PROGRAM
ifprogram
is not a valid program object.INVALID_VALUE
ifdevice_list
isNULL
andnum_devices
is > 0, or ifdevice_list
is notNULL
andnum_devices
is 0.INVALID_VALUE
ifpfn_notify
isNULL
butuser_data
is notNULL
.INVALID_DEVICE
if OpenCL devices listed indevice_list
are not in the list of devices associated with program.INVALID_BINARY
ifprogram
is created withCreateProgramWithBinary
and devices listed indevice_list
do not have a valid program binary loaded.INVALID_BUILD_OPTIONS
if the build options specified byoptions
are invalid.INVALID_OPERATION
if the build of a program executable for any of the devices listed indevice_list
by a previous call toclBuildProgram
forprogram
has not completed.COMPILER_NOT_AVAILABLE
ifprogram
is created withCreateProgramWithSource
and a compiler is not available i.e.DEVICE_COMPILER_AVAILABLE
is set toFALSE
.BUILD_PROGRAM_FAILURE
if there is a failure to build the program executable. This error will be returned ifclBuildProgram
does not return until the build has completed.INVALID_OPERATION
if there are kernel objects attached toprogram
.INVALID_OPERATION
if program was not created withCreateProgramWithSource
orCreateProgramWithBinary
.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:
-
clBuildProgram
public static int clBuildProgram(long program, long device, CharSequence options, @Nullable CLProgramCallbackI pfn_notify, long user_data) Builds (compiles & links) a program executable from the program source or binary for all the devices or a specific device(s) in the OpenCL context associated withprogram
. OpenCL allows program executables to be built using the source or the binary.clBuildProgram
must be called forprogram
created using eitherCreateProgramWithSource
orCreateProgramWithBinary
to build the program executable for one or more devices associated withprogram
. Ifprogram
is created withCreateProgramWithBinary
, then the program binary must be an executable binary (not a compiled binary or library).The executable binary can be queried using
GetProgramInfo
and can be specified toCreateProgramWithBinary
to create a new program object.- Parameters:
program
- the program objectoptions
- a pointer to a null-terminated string of characters that describes the build options to be used for building the program executablepfn_notify
- a function pointer to a notification routine. The notification routine is a callback function that an application can register and which will be called when the program executable has been built (successfully or unsuccessfully). Ifpfn_notify
is notNULL
,clBuildProgram
does not need to wait for the build to complete and can return immediately once the build operation can begin. The build operation can begin if the context, program whose sources are being compiled and linked, list of devices and build options specified are all valid and appropriate host and device resources needed to perform the build are available. Ifpfn_notify
isNULL
,clBuildProgram
does not return until the build has completed. 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 an 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_PROGRAM
ifprogram
is not a valid program object.INVALID_VALUE
ifdevice_list
isNULL
andnum_devices
is > 0, or ifdevice_list
is notNULL
andnum_devices
is 0.INVALID_VALUE
ifpfn_notify
isNULL
butuser_data
is notNULL
.INVALID_DEVICE
if OpenCL devices listed indevice_list
are not in the list of devices associated with program.INVALID_BINARY
ifprogram
is created withCreateProgramWithBinary
and devices listed indevice_list
do not have a valid program binary loaded.INVALID_BUILD_OPTIONS
if the build options specified byoptions
are invalid.INVALID_OPERATION
if the build of a program executable for any of the devices listed indevice_list
by a previous call toclBuildProgram
forprogram
has not completed.COMPILER_NOT_AVAILABLE
ifprogram
is created withCreateProgramWithSource
and a compiler is not available i.e.DEVICE_COMPILER_AVAILABLE
is set toFALSE
.BUILD_PROGRAM_FAILURE
if there is a failure to build the program executable. This error will be returned ifclBuildProgram
does not return until the build has completed.INVALID_OPERATION
if there are kernel objects attached toprogram
.INVALID_OPERATION
if program was not created withCreateProgramWithSource
orCreateProgramWithBinary
.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:
-
clUnloadCompiler
public static int clUnloadCompiler()Allows the implementation to release the resources allocated by the OpenCL compiler. This is a hint from the application and does not guarantee that the compiler will not be used in the future or that the compiler will actually be unloaded by the implementation.Calls to
BuildProgram
afterUnloadCompiler
will reload the compiler, if necessary, to build the appropriate program executable.- Returns:
- always
SUCCESS
- See Also:
-
nclGetProgramInfo
public static int nclGetProgramInfo(long program, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetProgramInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetProgramInfo
public static int clGetProgramInfo(long program, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a program object.- Parameters:
program
- the program object being queriedparam_name
- the information to query. One of:PROGRAM_REFERENCE_COUNT
PROGRAM_CONTEXT
PROGRAM_NUM_DEVICES
PROGRAM_DEVICES
PROGRAM_SOURCE
PROGRAM_BINARY_SIZES
PROGRAM_BINARIES
PROGRAM_NUM_KERNELS
PROGRAM_KERNEL_NAMES
PROGRAM_IL
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_PROGRAM
ifprogram
is a not a valid program object.INVALID_PROGRAM_EXECUTABLE
ifparam_name
isPROGRAM_NUM_KERNELS
orPROGRAM_KERNEL_NAMES
and a successful program executable has not been built for at least one device in the list of devices associated withprogram
.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:
-
clGetProgramInfo
public static int clGetProgramInfo(long program, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a program object.- Parameters:
program
- the program object being queriedparam_name
- the information to query. One of:PROGRAM_REFERENCE_COUNT
PROGRAM_CONTEXT
PROGRAM_NUM_DEVICES
PROGRAM_DEVICES
PROGRAM_SOURCE
PROGRAM_BINARY_SIZES
PROGRAM_BINARIES
PROGRAM_NUM_KERNELS
PROGRAM_KERNEL_NAMES
PROGRAM_IL
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_PROGRAM
ifprogram
is a not a valid program object.INVALID_PROGRAM_EXECUTABLE
ifparam_name
isPROGRAM_NUM_KERNELS
orPROGRAM_KERNEL_NAMES
and a successful program executable has not been built for at least one device in the list of devices associated withprogram
.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:
-
clGetProgramInfo
public static int clGetProgramInfo(long program, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a program object.- Parameters:
program
- the program object being queriedparam_name
- the information to query. One of:PROGRAM_REFERENCE_COUNT
PROGRAM_CONTEXT
PROGRAM_NUM_DEVICES
PROGRAM_DEVICES
PROGRAM_SOURCE
PROGRAM_BINARY_SIZES
PROGRAM_BINARIES
PROGRAM_NUM_KERNELS
PROGRAM_KERNEL_NAMES
PROGRAM_IL
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_PROGRAM
ifprogram
is a not a valid program object.INVALID_PROGRAM_EXECUTABLE
ifparam_name
isPROGRAM_NUM_KERNELS
orPROGRAM_KERNEL_NAMES
and a successful program executable has not been built for at least one device in the list of devices associated withprogram
.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:
-
nclGetProgramBuildInfo
public static int nclGetProgramBuildInfo(long program, long device, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetProgramBuildInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetProgramBuildInfo
public static int clGetProgramBuildInfo(long program, long device, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns build information for each device in the program object.- Parameters:
program
- the program object being querieddevice
- the device for which build information is being queried.device
must be a valid device associated withprogram
.param_name
- the information to query. One of:PROGRAM_BUILD_STATUS
PROGRAM_BUILD_OPTIONS
PROGRAM_BUILD_LOG
PROGRAM_BINARY_TYPE
PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not in the list of devices associated with program.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_PROGRAM
ifprogram
is a not a valid program 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:
-
clGetProgramBuildInfo
public static int clGetProgramBuildInfo(long program, long device, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns build information for each device in the program object.- Parameters:
program
- the program object being querieddevice
- the device for which build information is being queried.device
must be a valid device associated withprogram
.param_name
- the information to query. One of:PROGRAM_BUILD_STATUS
PROGRAM_BUILD_OPTIONS
PROGRAM_BUILD_LOG
PROGRAM_BINARY_TYPE
PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not in the list of devices associated with program.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_PROGRAM
ifprogram
is a not a valid program 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:
-
clGetProgramBuildInfo
public static int clGetProgramBuildInfo(long program, long device, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns build information for each device in the program object.- Parameters:
program
- the program object being querieddevice
- the device for which build information is being queried.device
must be a valid device associated withprogram
.param_name
- the information to query. One of:PROGRAM_BUILD_STATUS
PROGRAM_BUILD_OPTIONS
PROGRAM_BUILD_LOG
PROGRAM_BINARY_TYPE
PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not in the list of devices associated with program.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_PROGRAM
ifprogram
is a not a valid program 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:
-
nclCreateKernel
public static long nclCreateKernel(long program, long kernel_name, long errcode_ret) Unsafe version of:CreateKernel
-
clCreateKernel
public static long clCreateKernel(long program, ByteBuffer kernel_name, @Nullable IntBuffer errcode_ret) Creates a kernel object.A kernel is a function declared in a program. A kernel is identified by the
__kernel
qualifier applied to any function in a program. A kernel object encapsulates the specific__kernel
function declared in a program and the argument values to be used when executing this__kernel
function.Kernel objects can only be created once you have a program object with a valid program source or binary loaded into the program object and the program executable has been successfully built for one or more devices associated with program. No changes to the program executable are allowed while there are kernel objects associated with a program object. This means that calls to
BuildProgram
andCompileProgram
returnINVALID_OPERATION
if there are kernel objects attached to a program object. The OpenCL context associated with program will be the context associated with kernel. The list of devices associated with program are the devices associated with kernel. Devices associated with a program object for which a valid program executable has been built can be used to execute kernels declared in the program object.- Parameters:
program
- a program object with a successfully built executablekernel_name
- a function name in the program declared with the__kernel
qualifiererrcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero kernel object and
errcode_ret
is set toSUCCESS
if the kernel object is created successfully. Otherwise, it returns aNULL
value with one of the following error values returned inerrcode_ret
:INVALID_PROGRAM
ifprogram
is not a valid program object.INVALID_PROGRAM_EXECUTABLE
if there is no successfully built executable forprogram
.INVALID_KERNEL_NAME
ifkernel_name
is not found inprogram
.INVALID_KERNEL_DEFINITION
if the function definition for__kernel
function given bykernel_name
such as the number of arguments, the argument types are not the same for all devices for which the program executable has been built.INVALID_VALUE
ifkernel_name
isNULL
.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:
-
clCreateKernel
public static long clCreateKernel(long program, CharSequence kernel_name, @Nullable IntBuffer errcode_ret) Creates a kernel object.A kernel is a function declared in a program. A kernel is identified by the
__kernel
qualifier applied to any function in a program. A kernel object encapsulates the specific__kernel
function declared in a program and the argument values to be used when executing this__kernel
function.Kernel objects can only be created once you have a program object with a valid program source or binary loaded into the program object and the program executable has been successfully built for one or more devices associated with program. No changes to the program executable are allowed while there are kernel objects associated with a program object. This means that calls to
BuildProgram
andCompileProgram
returnINVALID_OPERATION
if there are kernel objects attached to a program object. The OpenCL context associated with program will be the context associated with kernel. The list of devices associated with program are the devices associated with kernel. Devices associated with a program object for which a valid program executable has been built can be used to execute kernels declared in the program object.- Parameters:
program
- a program object with a successfully built executablekernel_name
- a function name in the program declared with the__kernel
qualifiererrcode_ret
- will return an appropriate error code. Iferrcode_ret
isNULL
, no error code is returned.- Returns:
- a valid non-zero kernel object and
errcode_ret
is set toSUCCESS
if the kernel object is created successfully. Otherwise, it returns aNULL
value with one of the following error values returned inerrcode_ret
:INVALID_PROGRAM
ifprogram
is not a valid program object.INVALID_PROGRAM_EXECUTABLE
if there is no successfully built executable forprogram
.INVALID_KERNEL_NAME
ifkernel_name
is not found inprogram
.INVALID_KERNEL_DEFINITION
if the function definition for__kernel
function given bykernel_name
such as the number of arguments, the argument types are not the same for all devices for which the program executable has been built.INVALID_VALUE
ifkernel_name
isNULL
.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:
-
nclCreateKernelsInProgram
public static int nclCreateKernelsInProgram(long program, int num_kernels, long kernels, long num_kernels_ret) Unsafe version of:CreateKernelsInProgram
- Parameters:
num_kernels
- the size of memory pointed to by kernels specified as the number of cl_kernel entries
-
clCreateKernelsInProgram
public static int clCreateKernelsInProgram(long program, @Nullable PointerBuffer kernels, @Nullable IntBuffer num_kernels_ret) Creates kernel objects for all kernel functions inprogram
. Kernel objects are not created for any__kernel
functions inprogram
that do not have the same function definition across all devices for which a program executable has been successfully built.See
CreateKernel
for more details.- Parameters:
program
- a program object with a successfully built executablekernels
- the buffer where the kernel objects for kernels inprogram
will be returned. Ifkernels
isNULL
, it is ignored. Ifkernels
is notNULL
,num_kernels
must be greater than or equal to the number of kernels inprogram
.num_kernels_ret
- the number of kernels inprogram
. Ifnum_kernels_ret
isNULL
, it is ignored.- Returns:
SUCCESS
if the kernel objects were successfully allocated. Otherwise, it returns one of the following errors:INVALID_PROGRAM
ifprogram
is not a valid program object.INVALID_PROGRAM_EXECUTABLE
if there is no successfully built executable for any device inprogram
.INVALID_VALUE
ifkernels
is notNULL
andnum_kernels
is less than the number of kernels inprogram
.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:
-
clRetainKernel
public static int clRetainKernel(long kernel) Increments thekernel
reference count.CreateKernel
orCreateKernelsInProgram
do an implicit retain.- Parameters:
kernel
- the kernel to retain- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
if kernel is not a valid kernel 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:
-
clReleaseKernel
public static int clReleaseKernel(long kernel) Decrements thekernel
reference count.The kernel object is deleted once the number of instances that are retained to
kernel
become zero and the kernel object is no longer needed by any enqueued commands that usekernel
.- Parameters:
kernel
- the kernel to release- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
if kernel is not a valid kernel 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:
-
nclSetKernelArg
public static int nclSetKernelArg(long kernel, int arg_index, long arg_size, long arg_value) Unsafe version of:SetKernelArg
- Parameters:
arg_size
- the size of the argument value. If the argument is a memory object, the size is the size of the buffer or image object type. For arguments declared with the__local
qualifier, the size specified will be the size in bytes of the buffer that must be allocated for the__local
argument. If the argument is of typesampler_t
, thearg_size
value must be equal tosizeof(cl_sampler)
. For all other arguments, the size will be the size of argument type.
-
clSetKernelArg
public static int clSetKernelArg(long kernel, int arg_index, long arg_size) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_size
- the size of the argument value. If the argument is a memory object, the size is the size of the buffer or image object type. For arguments declared with the__local
qualifier, the size specified will be the size in bytes of the buffer that must be allocated for the__local
argument. If the argument is of typesampler_t
, thearg_size
value must be equal tosizeof(cl_sampler)
. For all other arguments, the size will be the size of argument type.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg
Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_value
- a pointer to data that should be used as the argument value for argument specified byarg_index
. The argument data pointed to byarg_value
is copied and thearg_value
pointer can therefore be reused by the application afterclSetKernelArg
returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel
andEnqueueTask
) until the argument value is changed by a call toclSetKernelArg
forkernel
.If the argument is a memory object (buffer, image or image array), the
arg_value
entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, thearg_value
pointer can beNULL
or point to aNULL
value in which case aNULL
value will be used as the value for the argument declared as a pointer to__global
or__constant
memory in the kernel. If the argument is declared with the__local
qualifier, thearg_value
entry must beNULL
. If the argument is of typesampler_t
, thearg_value
entry must be a pointer to the sampler object.If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or
NULL
). If the argument is declared with the__constant
qualifier, the size in bytes of the memory object cannot exceedDEVICE_MAX_CONSTANT_BUFFER_SIZE
and the number of arguments declared as pointers to__constant
memory cannot exceedDEVICE_MAX_CONSTANT_ARGS
.The memory object specified as argument value must be a 2D image object if the argument is declared to be of type
image2d_t
. The memory object specified as argument value must be a 3D image object if argument is declared to be of typeimage3d_t
. The memory object specified as argument value must be a 1D image object if the argument is declared to be of typeimage1d_t
. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of typeimage1d_buffer_t
. The memory object specified as argument value must be a 1D image array object if argument is declared to be of typeimage1d_array_t
. The memory object specified as argument value must be a 2D image array object if argument is declared to be of typeimage2d_array_t
.For all other kernel arguments, the
arg_value
entry must be a pointer to the actual data to be used as argument value.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg
Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_value
- a pointer to data that should be used as the argument value for argument specified byarg_index
. The argument data pointed to byarg_value
is copied and thearg_value
pointer can therefore be reused by the application afterclSetKernelArg
returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel
andEnqueueTask
) until the argument value is changed by a call toclSetKernelArg
forkernel
.If the argument is a memory object (buffer, image or image array), the
arg_value
entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, thearg_value
pointer can beNULL
or point to aNULL
value in which case aNULL
value will be used as the value for the argument declared as a pointer to__global
or__constant
memory in the kernel. If the argument is declared with the__local
qualifier, thearg_value
entry must beNULL
. If the argument is of typesampler_t
, thearg_value
entry must be a pointer to the sampler object.If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or
NULL
). If the argument is declared with the__constant
qualifier, the size in bytes of the memory object cannot exceedDEVICE_MAX_CONSTANT_BUFFER_SIZE
and the number of arguments declared as pointers to__constant
memory cannot exceedDEVICE_MAX_CONSTANT_ARGS
.The memory object specified as argument value must be a 2D image object if the argument is declared to be of type
image2d_t
. The memory object specified as argument value must be a 3D image object if argument is declared to be of typeimage3d_t
. The memory object specified as argument value must be a 1D image object if the argument is declared to be of typeimage1d_t
. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of typeimage1d_buffer_t
. The memory object specified as argument value must be a 1D image array object if argument is declared to be of typeimage1d_array_t
. The memory object specified as argument value must be a 2D image array object if argument is declared to be of typeimage2d_array_t
.For all other kernel arguments, the
arg_value
entry must be a pointer to the actual data to be used as argument value.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg
Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_value
- a pointer to data that should be used as the argument value for argument specified byarg_index
. The argument data pointed to byarg_value
is copied and thearg_value
pointer can therefore be reused by the application afterclSetKernelArg
returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel
andEnqueueTask
) until the argument value is changed by a call toclSetKernelArg
forkernel
.If the argument is a memory object (buffer, image or image array), the
arg_value
entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, thearg_value
pointer can beNULL
or point to aNULL
value in which case aNULL
value will be used as the value for the argument declared as a pointer to__global
or__constant
memory in the kernel. If the argument is declared with the__local
qualifier, thearg_value
entry must beNULL
. If the argument is of typesampler_t
, thearg_value
entry must be a pointer to the sampler object.If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or
NULL
). If the argument is declared with the__constant
qualifier, the size in bytes of the memory object cannot exceedDEVICE_MAX_CONSTANT_BUFFER_SIZE
and the number of arguments declared as pointers to__constant
memory cannot exceedDEVICE_MAX_CONSTANT_ARGS
.The memory object specified as argument value must be a 2D image object if the argument is declared to be of type
image2d_t
. The memory object specified as argument value must be a 3D image object if argument is declared to be of typeimage3d_t
. The memory object specified as argument value must be a 1D image object if the argument is declared to be of typeimage1d_t
. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of typeimage1d_buffer_t
. The memory object specified as argument value must be a 1D image array object if argument is declared to be of typeimage1d_array_t
. The memory object specified as argument value must be a 2D image array object if argument is declared to be of typeimage2d_array_t
.For all other kernel arguments, the
arg_value
entry must be a pointer to the actual data to be used as argument value.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg
Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_value
- a pointer to data that should be used as the argument value for argument specified byarg_index
. The argument data pointed to byarg_value
is copied and thearg_value
pointer can therefore be reused by the application afterclSetKernelArg
returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel
andEnqueueTask
) until the argument value is changed by a call toclSetKernelArg
forkernel
.If the argument is a memory object (buffer, image or image array), the
arg_value
entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, thearg_value
pointer can beNULL
or point to aNULL
value in which case aNULL
value will be used as the value for the argument declared as a pointer to__global
or__constant
memory in the kernel. If the argument is declared with the__local
qualifier, thearg_value
entry must beNULL
. If the argument is of typesampler_t
, thearg_value
entry must be a pointer to the sampler object.If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or
NULL
). If the argument is declared with the__constant
qualifier, the size in bytes of the memory object cannot exceedDEVICE_MAX_CONSTANT_BUFFER_SIZE
and the number of arguments declared as pointers to__constant
memory cannot exceedDEVICE_MAX_CONSTANT_ARGS
.The memory object specified as argument value must be a 2D image object if the argument is declared to be of type
image2d_t
. The memory object specified as argument value must be a 3D image object if argument is declared to be of typeimage3d_t
. The memory object specified as argument value must be a 1D image object if the argument is declared to be of typeimage1d_t
. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of typeimage1d_buffer_t
. The memory object specified as argument value must be a 1D image array object if argument is declared to be of typeimage1d_array_t
. The memory object specified as argument value must be a 2D image array object if argument is declared to be of typeimage2d_array_t
.For all other kernel arguments, the
arg_value
entry must be a pointer to the actual data to be used as argument value.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg
Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_value
- a pointer to data that should be used as the argument value for argument specified byarg_index
. The argument data pointed to byarg_value
is copied and thearg_value
pointer can therefore be reused by the application afterclSetKernelArg
returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel
andEnqueueTask
) until the argument value is changed by a call toclSetKernelArg
forkernel
.If the argument is a memory object (buffer, image or image array), the
arg_value
entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, thearg_value
pointer can beNULL
or point to aNULL
value in which case aNULL
value will be used as the value for the argument declared as a pointer to__global
or__constant
memory in the kernel. If the argument is declared with the__local
qualifier, thearg_value
entry must beNULL
. If the argument is of typesampler_t
, thearg_value
entry must be a pointer to the sampler object.If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or
NULL
). If the argument is declared with the__constant
qualifier, the size in bytes of the memory object cannot exceedDEVICE_MAX_CONSTANT_BUFFER_SIZE
and the number of arguments declared as pointers to__constant
memory cannot exceedDEVICE_MAX_CONSTANT_ARGS
.The memory object specified as argument value must be a 2D image object if the argument is declared to be of type
image2d_t
. The memory object specified as argument value must be a 3D image object if argument is declared to be of typeimage3d_t
. The memory object specified as argument value must be a 1D image object if the argument is declared to be of typeimage1d_t
. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of typeimage1d_buffer_t
. The memory object specified as argument value must be a 1D image array object if argument is declared to be of typeimage1d_array_t
. The memory object specified as argument value must be a 2D image array object if argument is declared to be of typeimage2d_array_t
.For all other kernel arguments, the
arg_value
entry must be a pointer to the actual data to be used as argument value.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg
Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_value
- a pointer to data that should be used as the argument value for argument specified byarg_index
. The argument data pointed to byarg_value
is copied and thearg_value
pointer can therefore be reused by the application afterclSetKernelArg
returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel
andEnqueueTask
) until the argument value is changed by a call toclSetKernelArg
forkernel
.If the argument is a memory object (buffer, image or image array), the
arg_value
entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, thearg_value
pointer can beNULL
or point to aNULL
value in which case aNULL
value will be used as the value for the argument declared as a pointer to__global
or__constant
memory in the kernel. If the argument is declared with the__local
qualifier, thearg_value
entry must beNULL
. If the argument is of typesampler_t
, thearg_value
entry must be a pointer to the sampler object.If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or
NULL
). If the argument is declared with the__constant
qualifier, the size in bytes of the memory object cannot exceedDEVICE_MAX_CONSTANT_BUFFER_SIZE
and the number of arguments declared as pointers to__constant
memory cannot exceedDEVICE_MAX_CONSTANT_ARGS
.The memory object specified as argument value must be a 2D image object if the argument is declared to be of type
image2d_t
. The memory object specified as argument value must be a 3D image object if argument is declared to be of typeimage3d_t
. The memory object specified as argument value must be a 1D image object if the argument is declared to be of typeimage1d_t
. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of typeimage1d_buffer_t
. The memory object specified as argument value must be a 1D image array object if argument is declared to be of typeimage1d_array_t
. The memory object specified as argument value must be a 2D image array object if argument is declared to be of typeimage2d_array_t
.For all other kernel arguments, the
arg_value
entry must be a pointer to the actual data to be used as argument value.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg
Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.arg_value
- a pointer to data that should be used as the argument value for argument specified byarg_index
. The argument data pointed to byarg_value
is copied and thearg_value
pointer can therefore be reused by the application afterclSetKernelArg
returns. The argument value specified is the value used by all API calls that enqueue kernel (EnqueueNDRangeKernel
andEnqueueTask
) until the argument value is changed by a call toclSetKernelArg
forkernel
.If the argument is a memory object (buffer, image or image array), the
arg_value
entry will be a pointer to the appropriate buffer, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, thearg_value
pointer can beNULL
or point to aNULL
value in which case aNULL
value will be used as the value for the argument declared as a pointer to__global
or__constant
memory in the kernel. If the argument is declared with the__local
qualifier, thearg_value
entry must beNULL
. If the argument is of typesampler_t
, thearg_value
entry must be a pointer to the sampler object.If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or
NULL
). If the argument is declared with the__constant
qualifier, the size in bytes of the memory object cannot exceedDEVICE_MAX_CONSTANT_BUFFER_SIZE
and the number of arguments declared as pointers to__constant
memory cannot exceedDEVICE_MAX_CONSTANT_ARGS
.The memory object specified as argument value must be a 2D image object if the argument is declared to be of type
image2d_t
. The memory object specified as argument value must be a 3D image object if argument is declared to be of typeimage3d_t
. The memory object specified as argument value must be a 1D image object if the argument is declared to be of typeimage1d_t
. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of typeimage1d_buffer_t
. The memory object specified as argument value must be a 1D image array object if argument is declared to be of typeimage1d_array_t
. The memory object specified as argument value must be a 2D image array object if argument is declared to be of typeimage2d_array_t
.For all other kernel arguments, the
arg_value
entry must be a pointer to the actual data to be used as argument value.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg1b
public static int clSetKernelArg1b(long kernel, int arg_index, byte arg0) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg2b
public static int clSetKernelArg2b(long kernel, int arg_index, byte arg0, byte arg1) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg4b
public static int clSetKernelArg4b(long kernel, int arg_index, byte arg0, byte arg1, byte arg2, byte arg3) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg1s
public static int clSetKernelArg1s(long kernel, int arg_index, short arg0) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg2s
public static int clSetKernelArg2s(long kernel, int arg_index, short arg0, short arg1) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg4s
public static int clSetKernelArg4s(long kernel, int arg_index, short arg0, short arg1, short arg2, short arg3) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg1i
public static int clSetKernelArg1i(long kernel, int arg_index, int arg0) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg2i
public static int clSetKernelArg2i(long kernel, int arg_index, int arg0, int arg1) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg4i
public static int clSetKernelArg4i(long kernel, int arg_index, int arg0, int arg1, int arg2, int arg3) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg1l
public static int clSetKernelArg1l(long kernel, int arg_index, long arg0) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg2l
public static int clSetKernelArg2l(long kernel, int arg_index, long arg0, long arg1) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg4l
public static int clSetKernelArg4l(long kernel, int arg_index, long arg0, long arg1, long arg2, long arg3) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg1f
public static int clSetKernelArg1f(long kernel, int arg_index, float arg0) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg2f
public static int clSetKernelArg2f(long kernel, int arg_index, float arg0, float arg1) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg4f
public static int clSetKernelArg4f(long kernel, int arg_index, float arg0, float arg1, float arg2, float arg3) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg1d
public static int clSetKernelArg1d(long kernel, int arg_index, double arg0) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg2d
public static int clSetKernelArg2d(long kernel, int arg_index, double arg0, double arg1) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg4d
public static int clSetKernelArg4d(long kernel, int arg_index, double arg0, double arg1, double arg2, double arg3) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg1p
public static int clSetKernelArg1p(long kernel, int arg_index, long arg0) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg2p
public static int clSetKernelArg2p(long kernel, int arg_index, long arg0, long arg1) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
clSetKernelArg4p
public static int clSetKernelArg4p(long kernel, int arg_index, long arg0, long arg1, long arg2, long arg3) Set the argument value for a specific argument of a kernel.- Parameters:
kernel
- a valid kernel objectarg_index
- the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument ton - 1
, wheren
is the total number of arguments declared by a kernel.For example, consider the following kernel:
kernel void image_filter ( int n, int m, __constant float *filter_weights, __read_only image2d_t src_image, __write_only image2d_t dst_image ) { … }
Argument index values for image_filter will be 0 for
n
, 1 form
, 2 forfilter_weights
, 3 forsrc_image
and 4 fordst_image
.NOTE: A kernel object does not update the reference count for objects such as memory, sampler objects specified as argument values by
clSetKernelArg
, Users may not rely on a kernel object to retain objects specified as argument values to the kernel.- Returns:
SUCCESS
if the function was executed successfully. Otherwise, it returns one of the following errors:INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_ARG_INDEX
ifarg_index
is not a valid argument index.INVALID_ARG_VALUE
ifarg_value
specified is not a valid value.INVALID_MEM_OBJECT
for an argument declared to be a memory object when the specifiedarg_value
is not a valid memory object.INVALID_SAMPLER
for an argument declared to be of typesampler_t
when the specifiedarg_value
is not a valid sampler object.INVALID_ARG_SIZE
ifarg_size
does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object andarg_size != sizeof(cl_mem)
or ifarg_size
is zero and the argument is declared with the__local
qualifier or if the argument is a sampler andarg_size != sizeof(cl_sampler)
.MAX_SIZE_RESTRICTION_EXCEEDED
if the size in bytes of the memory object (if the argument was declared with constant qualifier) orarg_size
(if the argument was declared with local qualifier) exceed the maximum size restriction that was set with the optional language attribute. The optional attribute can becl::max_size
defined in OpenCL 2.2 C++ Kernel Language specification orSpvDecorationMaxByteOffset
defined in SPIR-V 1.2 Specification.INVALID_ARG_VALUE
if the argument is an image declared with theread_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_WRITE_ONLY
or if the image argument is declared with thewrite_only
qualifier andarg_value
refers to an image object created withcl_mem_flags
ofMEM_READ_ONLY
.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:
-
nclGetKernelInfo
public static int nclGetKernelInfo(long kernel, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetKernelInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetKernelInfo
public static int clGetKernelInfo(long kernel, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a kernel object.- Parameters:
kernel
- the kernel object being queriedparam_name
- the information to query. One of:KERNEL_FUNCTION_NAME
KERNEL_NUM_ARGS
KERNEL_REFERENCE_COUNT
KERNEL_CONTEXT
KERNEL_PROGRAM
KERNEL_ATTRIBUTES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_KERNEL
ifkernel
is a not a valid kernel 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:
-
clGetKernelInfo
public static int clGetKernelInfo(long kernel, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a kernel object.- Parameters:
kernel
- the kernel object being queriedparam_name
- the information to query. One of:KERNEL_FUNCTION_NAME
KERNEL_NUM_ARGS
KERNEL_REFERENCE_COUNT
KERNEL_CONTEXT
KERNEL_PROGRAM
KERNEL_ATTRIBUTES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_KERNEL
ifkernel
is a not a valid kernel 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:
-
clGetKernelInfo
public static int clGetKernelInfo(long kernel, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about a kernel object.- Parameters:
kernel
- the kernel object being queriedparam_name
- the information to query. One of:KERNEL_FUNCTION_NAME
KERNEL_NUM_ARGS
KERNEL_REFERENCE_COUNT
KERNEL_CONTEXT
KERNEL_PROGRAM
KERNEL_ATTRIBUTES
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_KERNEL
ifkernel
is a not a valid kernel 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:
-
nclGetKernelWorkGroupInfo
public static int nclGetKernelWorkGroupInfo(long kernel, long device, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetKernelWorkGroupInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetKernelWorkGroupInfo
public static int clGetKernelWorkGroupInfo(long kernel, long device, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.- Parameters:
kernel
- the kernel object being querieddevice
- identifies a specific device in the list of devices associated withkernel
. The list of devices is the list of devices in the OpenCL context that is associated withkernel
. If the list of devices associated withkernel
is a single device,device
can be aNULL
value.param_name
- the information to query. One of:KERNEL_WORK_GROUP_SIZE
KERNEL_COMPILE_WORK_GROUP_SIZE
KERNEL_LOCAL_MEM_SIZE
KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
KERNEL_PRIVATE_MEM_SIZE
KERNEL_GLOBAL_WORK_SIZE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not in the list of devices associated withkernel
or ifdevice
isNULL
but there is more than one device associated withkernel
.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_VALUE
ifparam_name
isKERNEL_GLOBAL_WORK_SIZE
anddevice
is not a custom device or kernel is not a built-in kernel.INVALID_KERNEL
ifkernel
is a not a valid kernel 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:
-
clGetKernelWorkGroupInfo
public static int clGetKernelWorkGroupInfo(long kernel, long device, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.- Parameters:
kernel
- the kernel object being querieddevice
- identifies a specific device in the list of devices associated withkernel
. The list of devices is the list of devices in the OpenCL context that is associated withkernel
. If the list of devices associated withkernel
is a single device,device
can be aNULL
value.param_name
- the information to query. One of:KERNEL_WORK_GROUP_SIZE
KERNEL_COMPILE_WORK_GROUP_SIZE
KERNEL_LOCAL_MEM_SIZE
KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
KERNEL_PRIVATE_MEM_SIZE
KERNEL_GLOBAL_WORK_SIZE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not in the list of devices associated withkernel
or ifdevice
isNULL
but there is more than one device associated withkernel
.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_VALUE
ifparam_name
isKERNEL_GLOBAL_WORK_SIZE
anddevice
is not a custom device or kernel is not a built-in kernel.INVALID_KERNEL
ifkernel
is a not a valid kernel 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:
-
clGetKernelWorkGroupInfo
public static int clGetKernelWorkGroupInfo(long kernel, long device, int param_name, @Nullable LongBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.- Parameters:
kernel
- the kernel object being querieddevice
- identifies a specific device in the list of devices associated withkernel
. The list of devices is the list of devices in the OpenCL context that is associated withkernel
. If the list of devices associated withkernel
is a single device,device
can be aNULL
value.param_name
- the information to query. One of:KERNEL_WORK_GROUP_SIZE
KERNEL_COMPILE_WORK_GROUP_SIZE
KERNEL_LOCAL_MEM_SIZE
KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
KERNEL_PRIVATE_MEM_SIZE
KERNEL_GLOBAL_WORK_SIZE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not in the list of devices associated withkernel
or ifdevice
isNULL
but there is more than one device associated withkernel
.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_VALUE
ifparam_name
isKERNEL_GLOBAL_WORK_SIZE
anddevice
is not a custom device or kernel is not a built-in kernel.INVALID_KERNEL
ifkernel
is a not a valid kernel 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:
-
clGetKernelWorkGroupInfo
public static int clGetKernelWorkGroupInfo(long kernel, long device, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about the kernel object that may be specific to a device.- Parameters:
kernel
- the kernel object being querieddevice
- identifies a specific device in the list of devices associated withkernel
. The list of devices is the list of devices in the OpenCL context that is associated withkernel
. If the list of devices associated withkernel
is a single device,device
can be aNULL
value.param_name
- the information to query. One of:KERNEL_WORK_GROUP_SIZE
KERNEL_COMPILE_WORK_GROUP_SIZE
KERNEL_LOCAL_MEM_SIZE
KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
KERNEL_PRIVATE_MEM_SIZE
KERNEL_GLOBAL_WORK_SIZE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_DEVICE
ifdevice
is not in the list of devices associated withkernel
or ifdevice
isNULL
but there is more than one device associated withkernel
.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_VALUE
ifparam_name
isKERNEL_GLOBAL_WORK_SIZE
anddevice
is not a custom device or kernel is not a built-in kernel.INVALID_KERNEL
ifkernel
is a not a valid kernel 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:
-
nclEnqueueNDRangeKernel
public static int nclEnqueueNDRangeKernel(long command_queue, long kernel, int work_dim, long global_work_offset, long global_work_size, long local_work_size, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueNDRangeKernel
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueNDRangeKernel
public static int clEnqueueNDRangeKernel(long command_queue, long kernel, int work_dim, @Nullable PointerBuffer global_work_offset, @Nullable PointerBuffer global_work_size, @Nullable PointerBuffer local_work_size, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to execute a kernel on a device.- Parameters:
command_queue
- a valid command-queue. The kernel will be queued for execution on the device associated withcommand_queue
.kernel
- a valid kernel object. The OpenCL context associated withkernel
andcommand_queue
must be the same.work_dim
- the number of dimensions used to specify the global work-items and work-items in the work-group.work_dim
must be greater than zero and less than or equal toDEVICE_MAX_WORK_ITEM_DIMENSIONS
.global_work_offset
- can be used to specify an array ofwork_dim
unsigned values that describe the offset used to calculate the global ID of a work-item. Ifglobal_work_offset
isNULL
, the global IDs start at offset(0, 0, … 0)
.global_work_size
- points to an array ofwork_dim
unsigned values that describe the number of global work-items inwork_dim
dimensions that will execute the kernel function. The total number of global work-items is computed asglobal_work_size[0] * … * global_work_size[work_dim – 1]
.local_work_size
- points to an array ofwork_dim
unsigned values that describe the number of work-items that make up a work-group (also referred to as the size of the work-group) that will execute the kernel specified bykernel
. The total number of work-items in a work-group is computed aslocal_work_size[0] * … * local_work_size[work_dim – 1]
. The total number of work-items in the work-group must be less than or equal to theDEVICE_MAX_WORK_GROUP_SIZE
value and the number of work-items specified inlocal_work_size[0], … local_work_size[work_dim – 1]
must be less than or equal to the corresponding values specified byDEVICE_MAX_WORK_ITEM_SIZES
[0]
, …DEVICE_MAX_WORK_ITEM_SIZES
[work_dim – 1]
. The explicitly specifiedlocal_work_size
will be used to determine how to break the global work-items specified byglobal_work_size
into appropriate work-group instances. Iflocal_work_size
is specified, the values specified inglobal_work_size[0], … global_work_size[work_dim - 1]
must be evenly divisible by the corresponding values specified inlocal_work_size[0], … local_work_size[work_dim – 1]
.The work-group size to be used for kernel can also be specified in the program source using the
__attribute__((reqd_work_group_size(X, Y, Z)))
qualifier. In this case the size of work group specified bylocal_work_size
must match the value specified by thereqd_work_group_size
attribute qualifier.local_work_size
can also be aNULL
value in which case the OpenCL implementation will determine how to be break the global work-items into appropriate work-group instances.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 kernel execution was successfully queued. Otherwise, it returns one of the following errors:INVALID_PROGRAM_EXECUTABLE
if there is no successfully built program executable available for device associated withcommand_queue
.INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_KERNEL
ifkernel
is not a valid kernel object.INVALID_CONTEXT
if context associated withcommand_queue
andkernel
are not the same or if the context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_KERNEL_ARGS
if the kernel argument values have not been specified.INVALID_WORK_DIMENSION
ifwork_dim
is not a valid value (i.e. a value between 1 and 3).INVALID_GLOBAL_WORK_SIZE
ifglobal_work_size
isNULL
, or if any of the values specified inglobal_work_size[0], … global_work_size[work_dim – 1]
are 0 or exceed the range given by thesizeof(size_t)
for the device on which the kernel execution will be enqueued.INVALID_GLOBAL_OFFSET
if the value specified inglobal_work_size
+ the corresponding values inglobal_work_offset
for any dimensions is greater than thesizeof(size_t)
for the device on which the kernel execution will be enqueued.INVALID_WORK_GROUP_SIZE
iflocal_work_size
is specified and number of work-items specified byglobal_work_size
is not evenly divisible by size of work-group given bylocal_work_size
or does not match the work-group size specified for kernel using the__attribute__((reqd_work_group_size(X, Y, Z)))
qualifier in program source.INVALID_WORK_GROUP_SIZE
iflocal_work_size
is specified and the total number of work-items in the work-group computed aslocal_work_size[0] * … * local_work_size[work_dim – 1]
is greater than the value specified byDEVICE_MAX_WORK_GROUP_SIZE
INVALID_WORK_GROUP_SIZE
iflocal_work_size
isNULL
and the__attribute__((reqd_work_group_size(X, Y, Z)))
qualifier is used to declare the work-group size for kernel in the program source.INVALID_WORK_ITEM_SIZE
if the number of work-items specified in any oflocal_work_size[0], … local_work_size[work_dim – 1]
is greater than the corresponding values specified byDEVICE_MAX_WORK_ITEM_SIZES
[0]
, …DEVICE_MAX_WORK_ITEM_SIZES
[work_dim – 1]
.MISALIGNED_SUB_BUFFER_OFFSET
if a sub-buffer object is specified as the value for an argument that is a buffer object and the offset specified when the sub-buffer object is created is not aligned toDEVICE_MEM_BASE_ADDR_ALIGN
value for device associated with queue.INVALID_IMAGE_SIZE
if an image object is specified as an argument value and the image dimensions (image width, height, specified or compute row and/or slice pitch) are not supported by device associated with queue.IMAGE_FORMAT_NOT_SUPPORTED
if an image object is specified as an argument value and the image format (image channel order and data type) is not supported by device associated with queue.OUT_OF_RESOURCES
if there is a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel. For example, the explicitly specifiedlocal_work_size
causes a failure to execute the kernel because of insufficient resources such as registers or local memory. Another example would be the number of read-only image args used in kernel exceed theDEVICE_MAX_READ_IMAGE_ARGS
value for device or the number of write-only image args used in kernel exceed theDEVICE_MAX_WRITE_IMAGE_ARGS
value for device or the number of samplers used in kernel exceedDEVICE_MAX_SAMPLERS
for device.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated with image or buffer objects specified as arguments to kernel.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.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:
-
nclEnqueueTask
public static int nclEnqueueTask(long command_queue, long kernel, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueTask
- Parameters:
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueTask
public static int clEnqueueTask(long command_queue, long kernel, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to execute a kernel on a device. The kernel is executed using a single work-item.clEnqueueTask
is equivalent to callingEnqueueNDRangeKernel
withwork_dim = 1
,global_work_offset = NULL
,global_work_size[0]
set to 1 andlocal_work_size[0]
set to 1.- Parameters:
command_queue
- a valid command-queue. The kernel will be queued for execution on the device associated withcommand_queue
.kernel
- a valid kernel object. The OpenCL context associated withkernel
andcommand_queue
must be the same.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 kernel execution was successfully queued. Otherwise, seeEnqueueNDRangeKernel
.- See Also:
-
nclEnqueueNativeKernel
public static int nclEnqueueNativeKernel(long command_queue, long user_func, long args, long cb_args, int num_mem_objects, long mem_list, long args_mem_loc, int num_events_in_wait_list, long event_wait_list, long event) Unsafe version of:EnqueueNativeKernel
- Parameters:
cb_args
- the size in bytes of the args list thatargs
points to.The data pointed to by
args
andcb_args
bytes in size will be copied and a pointer to this copied region will be passed touser_func
. The copy needs to be done because the memory objects (cl_mem values) that args may contain need to be modified and replaced by appropriate pointers to global memory. WhenclEnqueueNativeKernel
returns, the memory region pointed to by args can be reused by the application.num_mem_objects
- the number of buffer objects that are passed inargs
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueNativeKernel
public static int clEnqueueNativeKernel(long command_queue, CLNativeKernelI user_func, @Nullable ByteBuffer args, @Nullable PointerBuffer mem_list, @Nullable PointerBuffer args_mem_loc, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to execute a native C/C++ function not compiled using the OpenCL compiler.- Parameters:
command_queue
- a valid command-queue. A native user function can only be executed on a command-queue created on a device that hasEXEC_NATIVE_KERNEL
capability set inDEVICE_EXECUTION_CAPABILITIES
.user_func
- a pointer to a host-callable user functionargs
- a pointer to the args list thatuser_func
should be called withmem_list
- a list of valid buffer objects, ifnum_mem_objects
> 0. The buffer object values specified inmem_list
are memory object handles (cl_mem values) returned byCreateBuffer
orNULL
.args_mem_loc
- a pointer to appropriate locations thatargs
points to where memory object handles (cl_mem values) are stored. Before the user function is executed, the memory object handles are replaced by pointers to global memory.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 user function execution instance was successfully queued. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_VALUE
ifuser_func
isNULL
.INVALID_VALUE
ifargs
is aNULL
value andcb_args
> 0, or ifargs
is aNULL
value andnum_mem_objects
> 0.INVALID_VALUE
ifargs
is notNULL
andcb_args
is 0.INVALID_VALUE
ifnum_mem_objects
> 0 andmem_list
orargs_mem_loc
areNULL
.INVALID_VALUE
ifnum_mem_objects
= 0 andmem_list
orargs_mem_loc
are notNULL
.INVALID_OPERATION
if the device associated withcommand_queue
cannot execute the native kernel.INVALID_MEM_OBJECT
if one or more memory objects specified inmem_list
are not valid or are not buffer objects.OUT_OF_RESOURCES
if there is a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated with buffer objects specified as arguments to kernel.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.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:
-
clEnqueueNativeKernel
public static int clEnqueueNativeKernel(long command_queue, CLNativeKernelI user_func, @Nullable ByteBuffer args, long memobj, long memobj_loc, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Enqueues a command to execute a native C/C++ function not compiled using the OpenCL compiler.- Parameters:
command_queue
- a valid command-queue. A native user function can only be executed on a command-queue created on a device that hasEXEC_NATIVE_KERNEL
capability set inDEVICE_EXECUTION_CAPABILITIES
.user_func
- a pointer to a host-callable user functionargs
- a pointer to the args list thatuser_func
should be called withevent_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 user function execution instance was successfully queued. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_CONTEXT
if context associated withcommand_queue
and events inevent_wait_list
are not the same.INVALID_VALUE
ifuser_func
isNULL
.INVALID_VALUE
ifargs
is aNULL
value andcb_args
> 0, or ifargs
is aNULL
value andnum_mem_objects
> 0.INVALID_VALUE
ifargs
is notNULL
andcb_args
is 0.INVALID_VALUE
ifnum_mem_objects
> 0 andmem_list
orargs_mem_loc
areNULL
.INVALID_VALUE
ifnum_mem_objects
= 0 andmem_list
orargs_mem_loc
are notNULL
.INVALID_OPERATION
if the device associated withcommand_queue
cannot execute the native kernel.INVALID_MEM_OBJECT
if one or more memory objects specified inmem_list
are not valid or are not buffer objects.OUT_OF_RESOURCES
if there is a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel.MEM_OBJECT_ALLOCATION_FAILURE
if there is a failure to allocate memory for data store associated with buffer objects specified as arguments to kernel.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.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:
-
nclWaitForEvents
public static int nclWaitForEvents(int num_events, long event_list) Unsafe version of:WaitForEvents
- Parameters:
num_events
- the number of events inevent_list
-
clWaitForEvents
Waits on the host thread for commands identified by event objects inevent_list
to complete. A command is considered complete if its execution status isCOMPLETE
or a negative value. The events specified inevent_list
act as synchronization points.- Parameters:
event_list
- the list of events- Returns:
SUCCESS
if the execution status of all events in event_list isCOMPLETE
. Otherwise, it returns one of the following errors:INVALID_VALUE
ifnum_events
is zero orevent_list
isNULL
.INVALID_CONTEXT
if events specified inevent_list
do not belong to the same context.INVALID_EVENT
if event objects specified inevent_list
are not valid event objects.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the execution status of any of the events inevent_list
is a negative integer value.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:
-
clWaitForEvents
public static int clWaitForEvents(long event) Waits on the host thread for commands identified by event objects inevent_list
to complete. A command is considered complete if its execution status isCOMPLETE
or a negative value. The events specified inevent_list
act as synchronization points.- Returns:
SUCCESS
if the execution status of all events in event_list isCOMPLETE
. Otherwise, it returns one of the following errors:INVALID_VALUE
ifnum_events
is zero orevent_list
isNULL
.INVALID_CONTEXT
if events specified inevent_list
do not belong to the same context.INVALID_EVENT
if event objects specified inevent_list
are not valid event objects.EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
if the execution status of any of the events inevent_list
is a negative integer value.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:
-
nclGetEventInfo
public static int nclGetEventInfo(long event, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetEventInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetEventInfo
public static int clGetEventInfo(long event, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about an event object.Using
clGetEventInfo
to determine if a command identified by event has finished execution (i.e.EVENT_COMMAND_EXECUTION_STATUS
returnsCOMPLETE
) is not a synchronization point. There are no guarantees that the memory objects being modified by command associated with event will be visible to other enqueued commands.- Parameters:
event
- the event object being queriedparam_name
- the information to query. One of:EVENT_COMMAND_QUEUE
EVENT_COMMAND_TYPE
EVENT_REFERENCE_COUNT
EVENT_COMMAND_EXECUTION_STATUS
EVENT_CONTEXT
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_VALUE
if information to query given inparam_name
cannot be queried for event.INVALID_EVENT
ifevent
is a not a valid event 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:
-
clGetEventInfo
public static int clGetEventInfo(long event, int param_name, @Nullable IntBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about an event object.Using
clGetEventInfo
to determine if a command identified by event has finished execution (i.e.EVENT_COMMAND_EXECUTION_STATUS
returnsCOMPLETE
) is not a synchronization point. There are no guarantees that the memory objects being modified by command associated with event will be visible to other enqueued commands.- Parameters:
event
- the event object being queriedparam_name
- the information to query. One of:EVENT_COMMAND_QUEUE
EVENT_COMMAND_TYPE
EVENT_REFERENCE_COUNT
EVENT_COMMAND_EXECUTION_STATUS
EVENT_CONTEXT
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_VALUE
if information to query given inparam_name
cannot be queried for event.INVALID_EVENT
ifevent
is a not a valid event 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:
-
clGetEventInfo
public static int clGetEventInfo(long event, int param_name, @Nullable PointerBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns information about an event object.Using
clGetEventInfo
to determine if a command identified by event has finished execution (i.e.EVENT_COMMAND_EXECUTION_STATUS
returnsCOMPLETE
) is not a synchronization point. There are no guarantees that the memory objects being modified by command associated with event will be visible to other enqueued commands.- Parameters:
event
- the event object being queriedparam_name
- the information to query. One of:EVENT_COMMAND_QUEUE
EVENT_COMMAND_TYPE
EVENT_REFERENCE_COUNT
EVENT_COMMAND_EXECUTION_STATUS
EVENT_CONTEXT
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_VALUE
if information to query given inparam_name
cannot be queried for event.INVALID_EVENT
ifevent
is a not a valid event 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:
-
clRetainEvent
public static int clRetainEvent(long event) Increments the event reference count. The OpenCL commands that return an event perform an implicit retain.- Parameters:
event
- the event to retain- 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.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:
-
clReleaseEvent
public static int clReleaseEvent(long event) Decrements the event reference count.The event object is deleted once the reference count becomes zero, the specific command identified by this event has completed (or terminated) and there are no commands in the command-queues of a context that require a wait for this event to complete.
NOTE: Developers should be careful when releasing their last reference count on events created by
CreateUserEvent
that have not yet been set to status ofCOMPLETE
or an error. If the user event was used in theevent_wait_list
argument passed to a clEnqueue*** API or another application host thread is waiting for it inWaitForEvents
, those commands and host threads will continue to wait for the event status to reachCOMPLETE
or error, even after the user has released the object. Since in this scenario the developer has released his last reference count to the user event, it would be in principle no longer valid for him to change the status of the event to unblock all the other machinery. As a result the waiting tasks will wait forever, and associated events, cl_mem objects, command queues and contexts are likely to leak. In-order command-queues caught up in this deadlock may cease to do any work.- Parameters:
event
- the event to release- 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.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:
-
nclEnqueueMarker
public static int nclEnqueueMarker(long command_queue, long event) Unsafe version of:EnqueueMarker
-
clEnqueueMarker
Enqueues a marker command tocommand_queue
. The marker command is not completed until all commands enqueued before it have completed. The marker command returns an event which can be waited on, i.e. this event can be waited on to insure that all commands, which have been queued before the marker command, have been completed.- Parameters:
command_queue
- the command-queue to insert the marker toevent
- 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 successfully executed. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.INVALID_VALUE
ifevent
is aNULL
value.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:
-
clEnqueueBarrier
public static int clEnqueueBarrier(long command_queue) Enqueues a barrier operation. TheclEnqueueBarrier
command ensures that all queued commands incommand_queue
have finished execution before the next batch of commands can begin execution. TheclEnqueueBarrier
command is a synchronization point.- Parameters:
command_queue
- the command-queue to insert the barrier to- Returns:
SUCCESS
if the function is successfully executed. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.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:
-
nclEnqueueWaitForEvents
public static int nclEnqueueWaitForEvents(long command_queue, int num_events, long event_list) Unsafe version of:EnqueueWaitForEvents
- Parameters:
num_events
- the number of events inevent_list
-
clEnqueueWaitForEvents
Enqueues a wait for a specific event or a list of events to complete before any future commands queued in the command-queue are executed.- Parameters:
command_queue
- the command-queueevent_list
- the list of events- Returns:
SUCCESS
if the function was successfully executed. 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
and events inevent_list
are not the same.INVALID_VALUE
ifnum_events
is zero orevent_list
isNULL
.INVALID_EVENT
if event objects specified inevent_list
are not valid events.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:
-
clEnqueueWaitForEvents
public static int clEnqueueWaitForEvents(long command_queue, long event) Enqueues a wait for a specific event or a list of events to complete before any future commands queued in the command-queue are executed.- Parameters:
command_queue
- the command-queue- Returns:
SUCCESS
if the function was successfully executed. 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
and events inevent_list
are not the same.INVALID_VALUE
ifnum_events
is zero orevent_list
isNULL
.INVALID_EVENT
if event objects specified inevent_list
are not valid events.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:
-
nclGetEventProfilingInfo
public static int nclGetEventProfilingInfo(long event, int param_name, long param_value_size, long param_value, long param_value_size_ret) Unsafe version of:GetEventProfilingInfo
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
clGetEventProfilingInfo
public static int clGetEventProfilingInfo(long event, int param_name, @Nullable ByteBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns profiling information for the command associated withevent
.- Parameters:
event
- the event objectparam_name
- the profiling data to query. One of:PROFILING_COMMAND_QUEUED
PROFILING_COMMAND_SUBMIT
PROFILING_COMMAND_START
PROFILING_COMMAND_END
PROFILING_COMMAND_COMPLETE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully and the profiling information has been recorded. Otherwise, it returns one of the following errors:PROFILING_INFO_NOT_AVAILABLE
if theQUEUE_PROFILING_ENABLE
flag is not set for the command-queue, if the execution status of the command identified byevent
is notCOMPLETE
or ifevent
is a user event object.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_EVENT
ifevent
is a not a valid event 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:
-
clGetEventProfilingInfo
public static int clGetEventProfilingInfo(long event, int param_name, @Nullable LongBuffer param_value, @Nullable PointerBuffer param_value_size_ret) Returns profiling information for the command associated withevent
.- Parameters:
event
- the event objectparam_name
- the profiling data to query. One of:PROFILING_COMMAND_QUEUED
PROFILING_COMMAND_SUBMIT
PROFILING_COMMAND_START
PROFILING_COMMAND_END
PROFILING_COMMAND_COMPLETE
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully and the profiling information has been recorded. Otherwise, it returns one of the following errors:PROFILING_INFO_NOT_AVAILABLE
if theQUEUE_PROFILING_ENABLE
flag is not set for the command-queue, if the execution status of the command identified byevent
is notCOMPLETE
or ifevent
is a user event object.INVALID_VALUE
ifparam_name
is not valid, or if size in bytes specified byparam_value_size
is < size of return type andparam_value
is notNULL
.INVALID_EVENT
ifevent
is a not a valid event 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:
-
clFlush
public static int clFlush(long command_queue) Issues all previously queued OpenCL commands incommand_queue
to the device associated withcommand_queue
.clFlush
only guarantees that all queued commands tocommand_queue
will eventually be submitted to the appropriate device. There is no guarantee that they will be complete afterclFlush
returns.Any blocking commands queued in a command-queue and
ReleaseCommandQueue
perform an implicit flush of the command-queue. These blocking commands areEnqueueReadBuffer
,EnqueueReadBufferRect
,EnqueueReadImage
, withblocking_read
set toTRUE
;EnqueueWriteBuffer
,EnqueueWriteBufferRect
,EnqueueWriteImage
withblocking_write
set toTRUE
;EnqueueMapBuffer
,EnqueueMapImage
withblocking_map
set toTRUE
; orWaitForEvents
.To use event objects that refer to commands enqueued in a command-queue as event objects to wait on by commands enqueued in a different command-queue, the application must call a
clFlush
or any blocking commands that perform an implicit flush of the command-queue where the commands that refer to these event objects are enqueued.- Parameters:
command_queue
- the command-queue- Returns:
SUCCESS
if the function call was executed successfully. Otherwise, it returns one of the following errors:INVALID_COMMAND_QUEUE
ifcommand_queue
is not a valid command-queue.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:
-
clFinish
public static int clFinish(long command_queue) Blocks until all previously queued OpenCL commands incommand_queue
are issued to the associated device and have completed.clFinish
does not return until all previously queued commands incommand_queue
have been processed and completed.clFinish
is also a synchronization point.- Parameters:
command_queue
- the command-queue- See Also:
-
nclGetExtensionFunctionAddress
public static long nclGetExtensionFunctionAddress(long funcname) Unsafe version of:GetExtensionFunctionAddress
-
clGetExtensionFunctionAddress
Returns the address of the extension function named byfuncname
. The pointer returned should be cast to a function pointer type matching the extension function's definition defined in the appropriate extension specification and header file. A return value ofNULL
indicates that the specified function does not exist for the implementation. A non-NULL
return value forclGetExtensionFunctionAddress
does not guarantee that an extension function is actually supported. The application must also make a corresponding query usingclGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS, … )
orclGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, … )
to determine if an extension is supported by the OpenCL implementation.clGetExtensionFunctionAddress
may not be queried for core (non-extension) functions in OpenCL. For functions that are queryable withclGetExtensionFunctionAddress
, implementations may choose to also export those functions statically from the object libraries implementing those functions. However, portable applications cannot rely on this behavior.- Parameters:
funcname
- the extension function name- Returns:
- the extension function address
- See Also:
-
clGetExtensionFunctionAddress
Returns the address of the extension function named byfuncname
. The pointer returned should be cast to a function pointer type matching the extension function's definition defined in the appropriate extension specification and header file. A return value ofNULL
indicates that the specified function does not exist for the implementation. A non-NULL
return value forclGetExtensionFunctionAddress
does not guarantee that an extension function is actually supported. The application must also make a corresponding query usingclGetPlatformInfo(platform, CL_PLATFORM_EXTENSIONS, … )
orclGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, … )
to determine if an extension is supported by the OpenCL implementation.clGetExtensionFunctionAddress
may not be queried for core (non-extension) functions in OpenCL. For functions that are queryable withclGetExtensionFunctionAddress
, implementations may choose to also export those functions statically from the object libraries implementing those functions. However, portable applications cannot rely on this behavior.- Parameters:
funcname
- the extension function name- Returns:
- the extension function address
- See Also:
-
clGetPlatformIDs
public static int clGetPlatformIDs(@Nullable PointerBuffer platforms, @Nullable int[] num_platforms) Array version of:GetPlatformIDs
- See Also:
-
clGetPlatformInfo
public static int clGetPlatformInfo(long platform, int param_name, @Nullable long[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetPlatformInfo
- See Also:
-
clGetDeviceIDs
public static int clGetDeviceIDs(long platform, long device_type, @Nullable PointerBuffer devices, @Nullable int[] num_devices) Array version of:GetDeviceIDs
- See Also:
-
clGetDeviceInfo
public static int clGetDeviceInfo(long device, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetDeviceInfo
- See Also:
-
clGetDeviceInfo
public static int clGetDeviceInfo(long device, int param_name, @Nullable long[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetDeviceInfo
- See Also:
-
clCreateContext
public static long clCreateContext(@Nullable PointerBuffer properties, PointerBuffer devices, @Nullable CLContextCallbackI pfn_notify, long user_data, @Nullable int[] errcode_ret) Array version of:CreateContext
- See Also:
-
clCreateContextFromType
public static long clCreateContextFromType(@Nullable PointerBuffer properties, long device_type, @Nullable CLContextCallbackI pfn_notify, long user_data, @Nullable int[] errcode_ret) Array version of:CreateContextFromType
- See Also:
-
clGetContextInfo
public static int clGetContextInfo(long context, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetContextInfo
- See Also:
-
clCreateCommandQueue
public static long clCreateCommandQueue(long context, long device, long properties, @Nullable int[] errcode_ret) Array version of:CreateCommandQueue
- See Also:
-
clGetCommandQueueInfo
public static int clGetCommandQueueInfo(long command_queue, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetCommandQueueInfo
- See Also:
-
clGetCommandQueueInfo
public static int clGetCommandQueueInfo(long command_queue, int param_name, @Nullable long[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetCommandQueueInfo
- See Also:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, ByteBuffer host_ptr, @Nullable int[] errcode_ret) Array version of:CreateBuffer
- See Also:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, short[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateBuffer
- See Also:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, int[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateBuffer
- See Also:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, float[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateBuffer
- See Also:
-
clCreateBuffer
public static long clCreateBuffer(long context, long flags, double[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateBuffer
- See Also:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, short[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBuffer
- See Also:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, int[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBuffer
- See Also:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, float[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBuffer
- See Also:
-
clEnqueueReadBuffer
public static int clEnqueueReadBuffer(long command_queue, long buffer, boolean blocking_read, long offset, double[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadBuffer
- See Also:
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, short[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBuffer
- See Also:
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, int[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBuffer
- See Also:
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, float[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBuffer
- See Also:
-
clEnqueueWriteBuffer
public static int clEnqueueWriteBuffer(long command_queue, long buffer, boolean blocking_write, long offset, double[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteBuffer
- See Also:
-
clEnqueueMapBuffer
@Nullable public static ByteBuffer clEnqueueMapBuffer(long command_queue, long buffer, boolean blocking_map, long map_flags, long offset, long size, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event, @Nullable int[] errcode_ret, @Nullable ByteBuffer old_buffer) Array version of:EnqueueMapBuffer
- See Also:
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable ByteBuffer host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage2D
- See Also:
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable short[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage2D
- See Also:
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable int[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage2D
- See Also:
-
clCreateImage2D
public static long clCreateImage2D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_row_pitch, @Nullable float[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage2D
- See Also:
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable ByteBuffer host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage3D
- See Also:
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable short[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage3D
- See Also:
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable int[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage3D
- See Also:
-
clCreateImage3D
public static long clCreateImage3D(long context, long flags, CLImageFormat image_format, long image_width, long image_height, long image_depth, long image_row_pitch, long image_slice_pitch, @Nullable float[] host_ptr, @Nullable int[] errcode_ret) Array version of:CreateImage3D
- See Also:
-
clGetSupportedImageFormats
public static int clGetSupportedImageFormats(long context, long flags, int image_type, @Nullable CLImageFormat.Buffer image_formats, @Nullable int[] num_image_formats) Array version of:GetSupportedImageFormats
- See Also:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, short[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadImage
- See Also:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, int[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadImage
- See Also:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, float[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadImage
- See Also:
-
clEnqueueReadImage
public static int clEnqueueReadImage(long command_queue, long image, boolean blocking_read, PointerBuffer origin, PointerBuffer region, long row_pitch, long slice_pitch, double[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueReadImage
- See Also:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, short[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteImage
- See Also:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, int[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteImage
- See Also:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, float[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteImage
- See Also:
-
clEnqueueWriteImage
public static int clEnqueueWriteImage(long command_queue, long image, boolean blocking_write, PointerBuffer origin, PointerBuffer region, long input_row_pitch, long input_slice_pitch, double[] ptr, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event) Array version of:EnqueueWriteImage
- See Also:
-
clEnqueueMapImage
@Nullable public static ByteBuffer clEnqueueMapImage(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, @Nullable PointerBuffer image_slice_pitch, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event, @Nullable int[] errcode_ret, @Nullable ByteBuffer old_buffer) Array version of:EnqueueMapImage
- See Also:
-
clEnqueueMapImage
@Nullable public static ByteBuffer clEnqueueMapImage(long command_queue, long image, boolean blocking_map, long map_flags, PointerBuffer origin, PointerBuffer region, PointerBuffer image_row_pitch, @Nullable PointerBuffer image_slice_pitch, @Nullable PointerBuffer event_wait_list, @Nullable PointerBuffer event, @Nullable int[] errcode_ret, long length, @Nullable ByteBuffer old_buffer) Array version of:EnqueueMapImage
- See Also:
-
clGetImageInfo
public static int clGetImageInfo(long image, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetImageInfo
- See Also:
-
clGetMemObjectInfo
public static int clGetMemObjectInfo(long memobj, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetMemObjectInfo
- See Also:
-
clGetMemObjectInfo
public static int clGetMemObjectInfo(long memobj, int param_name, @Nullable long[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetMemObjectInfo
- See Also:
-
clCreateSampler
public static long clCreateSampler(long context, boolean normalized_coords, int addressing_mode, int filter_mode, @Nullable int[] errcode_ret) Array version of:CreateSampler
- See Also:
-
clGetSamplerInfo
public static int clGetSamplerInfo(long sampler, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetSamplerInfo
- See Also:
-
clCreateProgramWithSource
public static long clCreateProgramWithSource(long context, PointerBuffer strings, @Nullable PointerBuffer lengths, @Nullable int[] errcode_ret) Array version of:CreateProgramWithSource
- See Also:
-
clCreateProgramWithBinary
public static long clCreateProgramWithBinary(long context, PointerBuffer device_list, PointerBuffer lengths, PointerBuffer binaries, @Nullable int[] binary_status, @Nullable int[] errcode_ret) Array version of:CreateProgramWithBinary
- See Also:
-
clGetProgramInfo
public static int clGetProgramInfo(long program, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetProgramInfo
- See Also:
-
clGetProgramBuildInfo
public static int clGetProgramBuildInfo(long program, long device, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetProgramBuildInfo
- See Also:
-
clCreateKernel
public static long clCreateKernel(long program, ByteBuffer kernel_name, @Nullable int[] errcode_ret) Array version of:CreateKernel
- See Also:
-
clCreateKernel
public static long clCreateKernel(long program, CharSequence kernel_name, @Nullable int[] errcode_ret) Array version of:CreateKernel
- See Also:
-
clCreateKernelsInProgram
public static int clCreateKernelsInProgram(long program, @Nullable PointerBuffer kernels, @Nullable int[] num_kernels_ret) Array version of:CreateKernelsInProgram
- See Also:
-
clSetKernelArg
public static int clSetKernelArg(long kernel, int arg_index, short[] arg_value) Array version of:SetKernelArg
- See Also:
-
clSetKernelArg
public static int clSetKernelArg(long kernel, int arg_index, int[] arg_value) Array version of:SetKernelArg
- See Also:
-
clSetKernelArg
public static int clSetKernelArg(long kernel, int arg_index, long[] arg_value) Array version of:SetKernelArg
- See Also:
-
clSetKernelArg
public static int clSetKernelArg(long kernel, int arg_index, float[] arg_value) Array version of:SetKernelArg
- See Also:
-
clSetKernelArg
public static int clSetKernelArg(long kernel, int arg_index, double[] arg_value) Array version of:SetKernelArg
- See Also:
-
clGetKernelInfo
public static int clGetKernelInfo(long kernel, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetKernelInfo
- See Also:
-
clGetKernelWorkGroupInfo
public static int clGetKernelWorkGroupInfo(long kernel, long device, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetKernelWorkGroupInfo
- See Also:
-
clGetKernelWorkGroupInfo
public static int clGetKernelWorkGroupInfo(long kernel, long device, int param_name, @Nullable long[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetKernelWorkGroupInfo
- See Also:
-
clGetEventInfo
public static int clGetEventInfo(long event, int param_name, @Nullable int[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetEventInfo
- See Also:
-
clGetEventProfilingInfo
public static int clGetEventProfilingInfo(long event, int param_name, @Nullable long[] param_value, @Nullable PointerBuffer param_value_size_ret) Array version of:GetEventProfilingInfo
- See Also:
-