Module: OpenCL
- Extended by:
- Library
- Includes:
- FFI
- Defined in:
- lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb,
lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb,
lib/opencl_ruby_ffi/Mem.rb,
lib/opencl_ruby_ffi/SVM.rb,
lib/opencl_ruby_ffi/Pipe.rb,
lib/opencl_ruby_ffi/Event.rb,
lib/opencl_ruby_ffi/Image.rb,
lib/opencl_ruby_ffi/Buffer.rb,
lib/opencl_ruby_ffi/Device.rb,
lib/opencl_ruby_ffi/Kernel.rb,
lib/opencl_ruby_ffi/Context.rb,
lib/opencl_ruby_ffi/Program.rb,
lib/opencl_ruby_ffi/Sampler.rb,
lib/opencl_ruby_ffi/khr/icd.rb,
lib/opencl_ruby_ffi/Platform.rb,
lib/opencl_ruby_ffi/khr/fp16.rb,
lib/opencl_ruby_ffi/khr/fp64.rb,
lib/opencl_ruby_ffi/khr/spir.rb,
lib/opencl_ruby_ffi/CommandQueue.rb,
lib/opencl_ruby_ffi/khr/gl_event.rb,
lib/opencl_ruby_ffi/opencl_types.rb,
lib/opencl_ruby_ffi/khr/egl_event.rb,
lib/opencl_ruby_ffi/khr/egl_image.rb,
lib/opencl_ruby_ffi/khr/gl_sharing.rb,
lib/opencl_ruby_ffi/khr/sub_groups.rb,
lib/opencl_ruby_ffi/khr/device_uuid.rb,
lib/opencl_ruby_ffi/intel/unofficial.rb,
lib/opencl_ruby_ffi/intel/accelerator.rb,
lib/opencl_ruby_ffi/khr/d3d10_sharing.rb,
lib/opencl_ruby_ffi/khr/d3d11_sharing.rb,
lib/opencl_ruby_ffi/ext/device_fission.rb,
lib/opencl_ruby_ffi/khr/priority_hints.rb,
lib/opencl_ruby_ffi/khr/throttle_hints.rb,
lib/opencl_ruby_ffi/khr/initalize_memory.rb,
lib/opencl_ruby_ffi/khr/dx9_media_sharing.rb,
lib/opencl_ruby_ffi/khr/terminate_context.rb,
lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb,
lib/opencl_ruby_ffi/intel/kernel_profiling.rb,
lib/opencl_ruby_ffi/intel/motion_estimation.rb,
lib/opencl_ruby_ffi/opencl_ruby_ffi_library.rb,
lib/opencl_ruby_ffi/intel/driver_diagnostics.rb,
lib/opencl_ruby_ffi/nv/device_attribute_query.rb,
lib/opencl_ruby_ffi/amd/device_attribute_query.rb,
lib/opencl_ruby_ffi/intel/advanced_motion_estimation.rb,
lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb,
lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb,
lib/opencl_ruby_ffi/intel/accelerator.rb,
lib/opencl_ruby_ffi/opencl_types.rb
Overview
Maps the OpenCL API using FFI
Defined Under Namespace
Classes: AcceleratorINTEL, AddressingMode, Bitfield, Buffer, BufferRegion, BuildStatus, ChannelOrder, ChannelType, Char1, Char16, Char2, Char4, Char8, CommandExecutionStatus, CommandQueue, CommandType, Context, Device, Double1, Double16, Double2, Double4, Double8, Enum, EnumInt, Error, Event, ExtendedStruct, FilterMode, Float1, Float16, Float2, Float4, Float8, Function, GLContextInfo, GLObjectType, GLsync, Half1, Half16, Half2, Half4, Half8, Image, ImageDesc, ImageFormat, Int1, Int16, Int2, Int4, Int8, Kernel, LUID, Long1, Long16, Long2, Long4, Long8, MapFlags, Mem, MemoryPointer, MotionEstimationDescINTEL, NameVersion, Pipe, Platform, Pointer, Program, SVMPointer, Sampler, Short1, Short16, Short2, Short4, Short8, Struct, UChar1, UChar16, UChar2, UChar4, UChar8, UInt1, UInt16, UInt2, UInt4, UInt8, ULong1, ULong16, ULong2, ULong4, ULong8, USMPointer, UShort1, UShort16, UShort2, UShort4, UShort8, UUID, UnifiedSharedMemoryCapabilitiesINTEL, Union, Version
Class Method Summary collapse
- .attach_extension_function(name, return_type, param_types, options = {}) ⇒ Object
-
.build_program(program, options = {}, &block) ⇒ Object
Builds (compile and link) a Program created from sources or binary.
- .clone_kernel(kernel) ⇒ Object
-
.compile_program(program, options = {}, &block) ⇒ Object
Compiles a Program created from sources.
-
.create_buffer(context, size, options = {}) ⇒ Object
Creates a Buffer.
-
.create_command_queue(context, device, options = {}) ⇒ Object
Creates a CommandQueue targeting the specified Device.
-
.create_context(devices, options = {}, &block) ⇒ Object
Creates an Context using the specified devices.
-
.create_context_from_type(type, options = {}, &block) ⇒ Object
Creates an Context using devices of the selected type.
- .create_event_from_glsync_khr(context, sync) ⇒ Object
-
.create_from_gl_buffer(context, bufobj, options = {}) ⇒ Object
(also: create_from_GL_buffer)
Creates Buffer from an opengl buffer.
-
.create_from_gl_renderbuffer(context, renderbuffer, options = {}) ⇒ Object
(also: create_from_GL_renderbuffer)
Creates an Image from an OpenGL render buffer.
-
.create_from_gl_texture(context, texture_target, texture, options = {}) ⇒ Object
(also: create_from_GL_texture)
Creates an Image from an OpenGL texture.
-
.create_from_gl_texture_2d(context, texture_target, texture, options = {}) ⇒ Object
(also: create_from_GL_texture_2D)
Creates an Image from an OpenGL 2D texture.
-
.create_from_gl_texture_3d(context, texture_target, texture, options = {}) ⇒ Object
(also: create_from_GL_texture_3D)
Creates an Image from an OpenGL 3D texture.
-
.create_image(context, format, desc, options = {}) ⇒ Object
Creates an Image.
-
.create_image_1d(context, format, width, options = {}) ⇒ Object
(also: create_image_1D)
Creates a 1D Image.
-
.create_image_2d(context, format, width, height, options = {}) ⇒ Object
(also: create_image_2D)
Creates a 2D Image.
-
.create_image_3d(context, format, width, height, depth, options = {}) ⇒ Object
(also: create_image_3D)
Creates a 3D Image.
-
.create_kernel(program, name) ⇒ Object
Returns the Kernel corresponding the the specified name in the given Program.
-
.create_kernels_in_program(program) ⇒ Object
Creates an Array of Kernel corresponding to the kernels defined inside the Program.
-
.create_pipe(context, pipe_packet_size, pipe_max_packets, options = {}) ⇒ Object
Creates a Pipe.
-
.create_program_with_binary(context, device_list, binaries) ⇒ Object
Creates a Program from binary.
-
.create_program_with_built_in_kernels(context, device_list, kernel_names) ⇒ Object
Creates a Program from a list of built in kernel names.
-
.create_program_with_il(context, il) ⇒ Object
Create a Program from an intermediate level representation.
-
.create_program_with_source(context, strings) ⇒ Object
Creates a Program from sources.
-
.create_sampler(context, options = {}) ⇒ Object
Creates a Sampler.
-
.create_sub_buffer(buffer, type, info, options = {}) ⇒ Object
Creates a Buffer from a sub part of an existing Buffer.
-
.create_sub_devices(in_device, properties) ⇒ Object
Splits a Device in serveral sub-devices.
- .create_sub_devices_ext(in_device, properties) ⇒ Object
-
.create_user_event(context) ⇒ Object
Creates a user Event.
-
.enqueue_acquire_gl_objects(command_queue, mem_objects, options = {}) ⇒ Object
(also: enqueue_acquire_GL_objects)
Acquire OpenCL Mem objects that have been created from OpenGL objects.
-
.enqueue_barrier(command_queue, events = []) ⇒ Object
Enqueues a barrier that prevents subsequent execution to take place in the command queue, until the barrier is considered finished.
-
.enqueue_copy_buffer(command_queue, src_buffer, dst_buffer, options = {}) ⇒ Object
Enqueues a command to copy data from a Buffer object into another Buffer object.
-
.enqueue_copy_buffer_rect(command_queue, src_buffer, dst_buffer, region, options = {}) ⇒ Object
Enqueues a command to copy a rectangular region into a Buffer object from another Buffer object.
-
.enqueue_copy_buffer_to_image(command_queue, src_buffer, dst_image, options = {}) ⇒ Object
Enqueues a command to copy a Buffer into an Image.
-
.enqueue_copy_image(command_queue, src_image, dst_image, options = {}) ⇒ Object
Enqueues a command to copy from an Image into an Image.
-
.enqueue_copy_image_to_buffer(command_queue, src_image, dst_buffer, options = {}) ⇒ Object
Enqueues a command to copy an Image into a Buffer.
-
.enqueue_fill_buffer(command_queue, buffer, pattern, options = {}) ⇒ Object
Enqueues a command to fill a Buffer with the given pattern.
-
.enqueue_fill_image(command_queue, image, fill_color, options = {}) ⇒ Object
Enqueues a command to fill an Image with the given color.
-
.enqueue_map_buffer(command_queue, buffer, map_flags, options = {}) ⇒ Object
Enqueues a command to map aa Buffer into host memory.
-
.enqueue_map_image(command_queue, image, map_flags, options = {}) ⇒ Object
Enqueues a command to map an Image into host memory.
-
.enqueue_marker(command_queue, events = []) ⇒ Object
Enqueues a marker.
-
.enqueue_migrate_mem_objects(command_queue, mem_objects, options = {}) ⇒ Object
Enqueues a command to indicate which device a set of memory objects should be migrated to.
-
.enqueue_native_kernel(command_queue, options = {}, &func) ⇒ Object
Enqueues a native kernel.
-
.enqueue_ndrange_kernel(command_queue, kernel, global_work_size, options = {}) ⇒ Object
(also: enqueue_NDrange_kernel)
Enqueues a kernel as a ndrange.
-
.enqueue_read_buffer(command_queue, buffer, ptr, options = {}) ⇒ Object
Enqueues a command to read from a Buffer object to host memory.
-
.enqueue_read_buffer_rect(command_queue, buffer, ptr, region, options = {}) ⇒ Object
Enqueues a command to read from a rectangular region from a Buffer object to host memory.
-
.enqueue_read_image(command_queue, image, ptr, options = {}) ⇒ Object
Enqueues a command to copy from an Image into host memory.
-
.enqueue_release_gl_objects(command_queue, mem_objects, options = {}) ⇒ Object
(also: enqueue_release_GL_objects)
Release OpenCL Mem objects that have been created from OpenGL objects and previously acquired.
-
.enqueue_svm_free(command_queue, svm_pointers, options = {}, &block) ⇒ Object
Enqueues a command that frees SVMPointers (or Pointers using a callback).
-
.enqueue_svm_map(command_queue, svm_ptr, map_flags, options = {}) ⇒ Object
Enqueues a command to map an Image into host memory.
-
.enqueue_svm_memcpy(command_queue, dst_ptr, src_ptr, options = {}) ⇒ Object
Enqueues a command to copy from or to an SVMPointer.
-
.enqueue_svm_memfill(command_queue, svm_ptr, pattern, options = {}) ⇒ Object
Enqueues a command to fill a an SVM memory area.
-
.enqueue_svm_migrate_mem(command_queue, svn_ptrs, options = {}) ⇒ Object
Enqueues a command to migrate SVM memory area ==== Attributes.
-
.enqueue_svm_unmap(command_queue, svm_ptr, options = {}) ⇒ Object
Enqueues a command to unmap a previously mapped SVM memory area.
-
.enqueue_task(command_queue, kernel, options = {}) ⇒ Object
Enqueues a kernel as a task.
-
.enqueue_unmap_mem_object(command_queue, mem_obj, mapped_ptr, options = {}) ⇒ Object
Enqueues a command to unmap a previously mapped region of a memory object.
-
.enqueue_wait_for_events(command_queue, events) ⇒ Object
Enqueues a barrier on a list of envents.
-
.enqueue_write_buffer(command_queue, buffer, ptr, options = {}) ⇒ Object
Enqueues a command to write to a Buffer object from host memory.
-
.enqueue_write_buffer_rect(command_queue, buffer, ptr, region, options = {}) ⇒ Object
Enqueues a command to write to a rectangular region in a Buffer object from host memory.
-
.enqueue_write_image(command_queue, image, ptr, options = {}) ⇒ Object
Enqueues a command to copy from host memory into an Image.
-
.finish(command_queue) ⇒ Object
Blocks until all the commands in the queue have completed.
-
.flush(command_queue) ⇒ Object
Issues all the commands in a CommandQueue to the Device.
- .get_device_and_host_timer(device) ⇒ Object
-
.get_extension_function(name, return_type, param_types, options = {}) ⇒ Object
Returns a Function corresponding to an extension function.
-
.get_extension_function_for_platform(platform, name, return_type, param_types, options = {}) ⇒ Object
Returns a Function corresponding to an extension function for the Platform.
- .get_gl_context_info_khr(properties, param_name) ⇒ Object
- .get_host_timer(device) ⇒ Object
-
.get_platforms ⇒ Object
(also: platforms)
Returns an Array of Platform containing the available OpenCL platforms.
-
.link_program(context, input_programs, options = {}, &block) ⇒ Object
Links a set of compiled programs for all device in a Context, or a subset of devices.
- .sBGRA ⇒ Object
-
.set_context_destructor_callback(context, options = {}, &block) ⇒ Object
Attaches a callback to context that will be called on context destruction.
- .set_default_device_command_queue(context, device, command_queue) ⇒ Object
-
.set_event_callback(event, command_exec_callback_type, options = {}, &proc) ⇒ Object
Attaches a callback to event that will be called on the given transition.
-
.set_kernel_arg(kernel, index, value, size = nil) ⇒ Object
Set the index th argument of Kernel to value.
-
.set_kernel_arg_svm_pointer(kernel, index, value) ⇒ Object
Set the index th argument of Kernel to value.
-
.set_mem_object_destructor_callback(memobj, options = {}, &block) ⇒ Object
Attaches a callback to memobj that will be called on memobj destruction.
-
.set_program_release_callback(program, options = {}, &block) ⇒ Object
Attaches a callback to program that will be called on program release.
-
.set_program_specialization_constant(program, spec_id, spec_value, spec_size = nil) ⇒ Object
Sets a specialization constant in a program.
-
.set_user_event_status(event, execution_status) ⇒ Object
Sets the satus of user Event to the given execution status.
- .sRGB ⇒ Object
- .sRGBA ⇒ Object
- .sRGBx ⇒ Object
-
.svm_alloc(context, size, options = {}) ⇒ Object
Creates an SVMPointer pointing to an SVM area of memory.
-
.svm_free(context, svm_pointer) ⇒ Object
Frees an SVMPointer.
- .terminate_context_khr(context) ⇒ Object
-
.unload_compiler ⇒ Object
Unloads the compiler.
-
.unload_platform_compiler(platform) ⇒ Object
Unloads a Platform compiler.
-
.wait_for_events(event_list) ⇒ Object
Waits for the command identified by Event objects to complete.
Class Method Details
.attach_extension_function(name, return_type, param_types, options = {}) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/opencl_ruby_ffi/Platform.rb', line 38 def self.attach_extension_function( name, return_type, param_types, = {} ) f = get_extension_function( name, return_type, param_types, ) if not f then warn "Warning: could not find extension function #{name}!" return nil end f.attach(OpenCL, name) end |
.build_program(program, options = {}, &block) ⇒ Object
Builds (compile and link) a Program created from sources or binary
Attributes
-
program
- the program to build -
options
- a hash containing named options -
block
- if provided, a callback invoked when the Program is built. Signature of the callback is { |Program, Pointer to user_data| … }
Options
-
:device_list
- an Array of Device to build the program for -
:options
- a String containing the options to use for the build -
:user_data
- a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 17 def self.build_program(program, = {}, &block) if block wrapper_block = lambda { |p, u| block.call(p, u) @@callbacks.delete(wrapper_block) } @@callbacks[wrapper_block] = [:user_data] else wrapper_block = nil end num_devices, devices_p = get_device_list( ) opt = "" opt = [:options] if [:options] = MemoryPointer.from_string(opt) error = clBuildProgram(program, num_devices, devices_p, , wrapper_block, [:user_data] ) error_check(error) return program end |
.clone_kernel(kernel) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 43 def self.clone_kernel( kernel ) error_check(INVALID_OPERATION) if kernel.context.platform.version_number < 2.1 error = MemoryPointer::new( :cl_int ) kernel_ptr = clCloneKernel( kernel, error ) error_check(error.read_cl_int) return Kernel::new( kernel_ptr, false ) end |
.compile_program(program, options = {}, &block) ⇒ Object
Compiles a Program created from sources
Attributes
-
program
- the program to build -
options
- a Hash containing named options -
block
- if provided, a callback invoked when the Program is compiled. Signature of the callback is { |Program, Pointer to user_data| … }
Options
-
:device_list
- an Array of Device to build the program for -
:user_data
- a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback -
:options
- a String containing the options to use for the compilation -
:input_headers
- a Hash containing pairs of : String: header_include_name => Program: header
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 88 def self.compile_program(program, = {}, &block) if block wrapper_block = lambda { |p, u| block.call(p, u) @@callbacks.delete(wrapper_block) } @@callbacks[wrapper_block] = [:user_data] else wrapper_block = nil end num_devices, devices_p = get_device_list( ) opt = "" opt = [:options] if [:options] = MemoryPointer.from_string(opt) headers = [:input_headers] headers_p = nil header_include_names = nil num_headers = 0 num_headers = headers.length if headers if num_headers > 0 then headers_p = MemoryPointer::new( Program, num_headers ) header_include_names = MemoryPointer::new( :pointer, num_headers ) indx = 0 headers.each { |key, value| headers_p[indx].write_pointer(value) header_include_names[indx] = MemoryPointer.from_string(key) indx = indx + 1 } end error = clCompileProgram(program, num_devices, devices_p, , num_headers, headers_p, header_include_names, wrapper_block, [:user_data] ) error_check(error) return program end |
.create_buffer(context, size, options = {}) ⇒ Object
Creates a Buffer
Attributes
-
context
- Context the created Buffer will be associated to -
size
- size of the Buffer to be created -
options
- a hash containing named options
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Buffer -
:host_ptr
- if provided, the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
:properties
- if provided, an array of :cl_mem_properties (OpenCL 3.0)
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/opencl_ruby_ffi/Buffer.rb', line 17 def self.create_buffer( context, size, = {} ) flags = get_flags( ) host_ptr = [:host_ptr] error = MemoryPointer::new( :cl_int ) if context.platform.version_number < 3.0 then buff = clCreateBuffer(context, flags, size, host_ptr, error) else properties = get_mem_properties( ) buff = clCreateBufferWithProperties(context, properties, flags, size, host_ptr, error) end error_check(error.read_cl_int) return Buffer::new( buff, false ) end |
.create_command_queue(context, device, options = {}) ⇒ Object
Creates a CommandQueue targeting the specified Device
Attributes
-
context
- the Context the CommandQueue will be associated with -
device
- the Device targetted by the CommandQueue being created -
options
- a hash containing named options
Options
-
:properties
- a single or an Array of :cl_command_queue_properties -
:size
- the size of the command queue ( if ON_DEVICE is specified in the properties ) 2.0+ only
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 38 def self.create_command_queue( context, device, = {} ) properties = get_command_queue_properties( ) size = [:size] error = MemoryPointer::new( :cl_int ) if device.platform.version_number < 2.0 then cmd = clCreateCommandQueue( context, device, properties, error ) else props = nil if properties.to_i != 0 or size then props_size = 0 props_size += 2 if properties.to_i != 0 props_size += 2 if size props_size += 1 if props_size > 0 props = MemoryPointer::new( :cl_queue_properties, props_size ) i=0 if properties.to_i != 0 then props[i].write_cl_queue_properties( CommandQueue::PROPERTIES ) props[i+1].write_cl_queue_properties( properties.to_i ) i += 2 end if size then props[i].write_cl_queue_properties( CommandQueue::SIZE ) props[i+1].write_cl_queue_properties( size ) i += 2 end props[i].write_cl_queue_properties( 0 ) end cmd = clCreateCommandQueueWithProperties( context, device, props, error ) end error_check(error.read_cl_int) return CommandQueue::new(cmd, false) end |
.create_context(devices, options = {}, &block) ⇒ Object
Creates an Context using the specified devices
Attributes
-
devices
- array of Device or a single Device -
options
- a hash containing named options -
block
- if provided, a callback invoked when error arise in the context. Signature of the callback is { |Pointer to null terminated c string, Pointer to binary data, :size_t number of bytes of binary data, Pointer to user_data| … }
Options
-
:properties
- a list of :cl_context_properties -
:user_data
- an Pointer or an object that can be converted into one using to_ptr. The pointer is passed to the callback.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/opencl_ruby_ffi/Context.rb', line 16 def self.create_context(devices, = {}, &block) if block @@callbacks[block] = [:user_data] end devs = [devices].flatten pointer = MemoryPointer::new( Device, devs.size) pointer.write_array_of_pointer(devs) properties = get_context_properties( ) user_data = [:user_data] error = MemoryPointer::new( :cl_int ) ptr = clCreateContext(properties, devs.size, pointer, block, user_data, error) error_check(error.read_cl_int) context = Context::new(ptr, false) if block && context.platform.version_number >= 3.0 callback_destructor_callback = lambda { |c, u| @@callbacks.delete(block) @@callbacks.delete(callback_destructor_callback) } @@callbacks[callback_destructor_callback] = nil context.set_destructor_callback(&callback_destructor_callback) end return context end |
.create_context_from_type(type, options = {}, &block) ⇒ Object
Creates an Context using devices of the selected type
Attributes
-
type
- a Device::Type -
options
- a hash containing named options -
block
- if provided, a callback invoked when error arise in the context. Signature of the callback is { |Pointer to null terminated c string, Pointer to binary data, :size_t number of bytes of binary data, Pointer to user_data| … }
Options
-
:properties
- a list of :cl_context_properties -
:user_data
- an Pointer or an object that can be converted into one using to_ptr. The pointer is passed to the callback.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/opencl_ruby_ffi/Context.rb', line 52 def self.create_context_from_type(type, = {}, &block) if block @@callbacks[block] = [:user_data] end properties = get_context_properties( ) user_data = [:user_data] error = MemoryPointer::new( :cl_int ) ptr = clCreateContextFromType(properties, type, block, user_data, error) error_check(error.read_cl_int) context = Context::new(ptr, false) if block && context.platform.version_number >= 3.0 callback_destructor_callback = lambda { |c, u| @@callbacks.delete(block) @@callbacks.delete(callback_destructor_callback) } @@callbacks[callback_destructor_callback] = nil context.set_destructor_callback(&callback_destructor_callback) end return context end |
.create_event_from_glsync_khr(context, sync) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/opencl_ruby_ffi/khr/gl_event.rb', line 9 def self.create_event_from_glsync_khr( context, sync) error_check(INVALID_OPERATION) unless context.platform.extensions.include?( "cl_khr_gl_event" ) or devices.first.extensions.include?("cl_khr_gl_event") error_p = MemoryPointer::new( :cl_int ) event = clCreateEventFromGLsyncKHR( context, sync, error_p ) error_check(error_p.read_cl_int) return Event::new( event, false ) end |
.create_from_gl_buffer(context, bufobj, options = {}) ⇒ Object Also known as: create_from_GL_buffer
Creates Buffer from an opengl buffer
Attributes
-
context
- Context the created Buffer will be associated to -
bufobj
- opengl buffer object -
options
- a hash containing named options
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image
63 64 65 66 67 68 69 |
# File 'lib/opencl_ruby_ffi/Buffer.rb', line 63 def self.create_from_gl_buffer( context, bufobj, = {} ) flags = get_flags( ) error = MemoryPointer::new( :cl_int ) buff = clCreateFromGLBuffer( context, flags, bufobj, error ) error_check(error.read_cl_int) return Buffer::new( buff, false ) end |
.create_from_gl_renderbuffer(context, renderbuffer, options = {}) ⇒ Object Also known as: create_from_GL_renderbuffer
Creates an Image from an OpenGL render buffer
Attributes
-
context
- Context the created Image will be associated to -
renderbuf
- opengl render buffer -
options
- a hash containing named options
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image
131 132 133 134 135 136 137 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 131 def self.create_from_gl_renderbuffer( context, renderbuffer, = {} ) flags = get_flags( ) error = MemoryPointer::new( :cl_int ) img = clCreateFromGLRenderbuffer( context, flags, renderbuffer, error ) error_check(error.read_cl_int) return Image::new( img, false ) end |
.create_from_gl_texture(context, texture_target, texture, options = {}) ⇒ Object Also known as: create_from_GL_texture
Creates an Image from an OpenGL texture
Attributes
-
context
- Context the created Image will be associated to -
texture_target
- a :GLenum defining the image type of texture -
texture
- a :GLuint specifying the name of the texture -
options
- a hash containing named options
Options
-
:miplevel
- a :GLint specifying the mipmap level to be used (default 0) -
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image
155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 155 def self.create_from_gl_texture( context, texture_target, texture, = {} ) if context.platform.version_number < 1.2 then error_check(INVALID_OPERATION) end flags = get_flags( ) miplevel = 0 miplevel = [:miplevel] if [:miplevel] error = MemoryPointer::new( :cl_int ) img = clCreateFromGLTexture( context, flags, texture_target, miplevel, texture, error ) error_check(error.read_cl_int) return Image::new( img, false ) end |
.create_from_gl_texture_2d(context, texture_target, texture, options = {}) ⇒ Object Also known as: create_from_GL_texture_2D
Creates an Image from an OpenGL 2D texture
Attributes
-
texture_target
- a :GLenum defining the image type of texture -
texture
- a :GLuint specifying the name of the texture -
options
- a hash containing named options
Options
-
:miplevel
- a :GLint specifying the mipmap level to be used (default 0) -
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image
183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 183 def self.create_from_gl_texture_2d( context, texture_target, texture, = {} ) if context.platform.version_number > 1.1 then return create_from_gl_texture( context, texture_target, texture, ) end flags = get_flags( ) miplevel = 0 miplevel = [:miplevel] if [:miplevel] error = MemoryPointer::new( :cl_int ) img = clCreateFromGLTexture2D( context, flags, texture_target, miplevel, texture, error ) error_check(error.read_cl_int) return Image::new( img, false ) end |
.create_from_gl_texture_3d(context, texture_target, texture, options = {}) ⇒ Object Also known as: create_from_GL_texture_3D
Creates an Image from an OpenGL 3D texture
Attributes
-
texture_target
- a :GLenum defining the image type of texture -
texture
- a :GLuint specifying the name of the texture -
options
- a hash containing named options
Options
-
:miplevel
- a :GLint specifying the mipmap level to be used (default 0) -
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image
211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 211 def self.create_from_gl_texture_3d( context, texture_target, texture, = {} ) if context.platform.version_number > 1.1 then return create_from_gl_texture( context, texture_target, texture, ) end flags = get_flags( ) miplevel = 0 miplevel = [:miplevel] if [:miplevel] error = MemoryPointer::new( :cl_int ) img = clCreateFromGLTexture3D( context, flags, texture_target, miplevel, texture, error ) error_check(error.read_cl_int) return Image::new( img, false ) end |
.create_image(context, format, desc, options = {}) ⇒ Object
Creates an Image
Attributes
-
context
- Context the created Image will be associated to -
format
- an ImageFormat -
desc
- an ImageDesc
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image -
:host_ptr
- if provided, the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
:properties
- if provided, an array of :cl_mem_properties (OpenCL 3.0)
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 17 def self.create_image( context, format, desc, = {} ) flags = get_flags( ) host_ptr = [:host_ptr] error = MemoryPointer::new( :cl_int ) if context.platform.version_number < 3.0 then img_ptr = clCreateImage( context, flags, format, desc, host_ptr, error ) else properties = get_mem_properties( ) img_ptr = clCreateImageWithProperties( context, properties, flags, format, desc, host_ptr, error ) end error_check(error.read_cl_int) return Image::new(img_ptr, false) end |
.create_image_1d(context, format, width, options = {}) ⇒ Object Also known as: create_image_1D
Creates a 1D Image
Attributes
-
context
- Context the created Image will be associated to -
format
- an ImageFormat -
width
- width of the image
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image -
:host_ptr
- if provided, the Pointer (or convertible to Pointer using to_ptr) to the memory area to use
43 44 45 46 47 48 49 50 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 43 def self.create_image_1d( context, format, width, = {} ) if context.platform.version_number > 1.1 then desc = ImageDesc::new(Mem::IMAGE1D, width, 0, 0, 0, 0, 0, 0, 0, nil) return create_image( context, format, desc, ) else error_check(INVALID_OPERATION) end end |
.create_image_2d(context, format, width, height, options = {}) ⇒ Object Also known as: create_image_2D
Creates a 2D Image
Attributes
-
context
- Context the created Image will be associated to -
format
- an ImageFormat -
width
- width of the image
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image -
:host_ptr
- if provided, the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
:row_pitch
- if provided the row_pitch of data in host_ptr
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 68 def self.create_image_2d( context, format, width, height, = {} ) row_pitch = 0 row_pitch = [:row_pitch] if [:row_pitch] if context.platform.version_number > 1.1 then desc = ImageDesc::new(Mem::IMAGE2D, width, height, 0, 0, row_pitch, 0, 0, 0, nil) return create_image( context, format, desc, ) end flags = get_flags( ) host_ptr = [:host_ptr] error = MemoryPointer::new( :cl_int ) img_ptr = clCreateImage2D( context, flags, format, width, height, row_pitch, host_ptr, error ) error_check(error.read_cl_int) return Image::new(img_ptr, false) end |
.create_image_3d(context, format, width, height, depth, options = {}) ⇒ Object Also known as: create_image_3D
Creates a 3D Image
Attributes
-
context
- Context the created Image will be associated to -
format
- an ImageFormat -
width
- width of the image
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image -
:host_ptr
- if provided, the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
:row_pitch
- if provided the row_pitch of data in host_ptr -
:slice_pitch
- if provided the slice_pitch of data in host_ptr
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/opencl_ruby_ffi/Image.rb', line 100 def self.create_image_3d( context, format, width, height, depth, = {} ) row_pitch = 0 row_pitch = [:row_pitch] if [:row_pitch] slice_pitch = 0 slice_pitch = [:slice_pitch] if [:slice_pitch] if context.platform.version_number > 1.1 then desc = ImageDesc::new(Mem::IMAGE3D, width, height, depth, 0, row_pitch, slice_pitch, 0, 0, nil) return create_image( context, format, desc, ) end flags = get_flags( ) host_ptr = [:host_ptr] error = MemoryPointer::new( :cl_int ) img_ptr = clCreateImage3D( context, flags, format, width, height, depth, row_pitch, slice_pitch, host_ptr, error ) error_check(error.read_cl_int) return Image::new(img_ptr, false) end |
.create_kernel(program, name) ⇒ Object
Returns the Kernel corresponding the the specified name in the given Program
19 20 21 22 23 24 25 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 19 def self.create_kernel(program, name) error = MemoryPointer::new( :cl_int ) name = name.to_s kernel_ptr = clCreateKernel(program, name, error) error_check(error.read_cl_int) return Kernel::new( kernel_ptr, false ) end |
.create_kernels_in_program(program) ⇒ Object
Creates an Array of Kernel corresponding to the kernels defined inside the Program
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 5 def self.create_kernels_in_program( program ) num_ptr = MemoryPointer::new( :cl_uint ) error = clCreateKernelsInProgram( program, 0, nil, num_ptr ) error_check(error) num_kernels = num_ptr.read_cl_uint kernels_ptr = MemoryPointer::new( Kernel, num_kernels ) error = clCreateKernelsInProgram( program, num_kernels, kernels_ptr, nil ) error_check(error) return kernels_ptr.get_array_of_pointer(0, num_kernels).collect { |kernel_ptr| Kernel::new(kernel_ptr, false) } end |
.create_pipe(context, pipe_packet_size, pipe_max_packets, options = {}) ⇒ Object
Creates a Pipe
Attributes
-
context
- Context the created Pipe will be associated to -
pipe_packet_size
- size of a packet in the Pipe -
pipe_max_packets
- size of the Pipe in packet
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Pipe
15 16 17 18 19 20 21 22 |
# File 'lib/opencl_ruby_ffi/Pipe.rb', line 15 def self.create_pipe( context, pipe_packet_size, pipe_max_packets, = {} ) error_check(INVALID_OPERATION) if self.context.platform.version_number < 2.0 flags = get_flags( ) error = MemoryPointer::new( :cl_int ) pipe_ptr = clCreatePipe( context, flags, pipe_packet_size, pipe_max_packets, nil, error) error_check(error.read_cl_int) return Pipe::new(pipe_ptr, false) end |
.create_program_with_binary(context, device_list, binaries) ⇒ Object
Creates a Program from binary
Attributes
-
context
- Context the created Program will be associated to -
device_list
- an Array of Device to create the program for. Can throw an Error::INVALID_VALUE if the number of supplied devices is different from the number of supplied binaries. -
binaries
- Array of binaries
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 151 def self.create_program_with_binary(context, device_list, binaries) binaries = [binaries].flatten num_devices = binaries.length devices = [device_list].flatten error_check(INVALID_VALUE) if devices.length != binaries.length devices_p = MemoryPointer::new( Device, num_devices ) lengths = MemoryPointer::new( :size_t, num_devices ) binaries_p = MemoryPointer::new( :pointer, num_devices ) num_devices.times { |indx| devices_p[indx].write_pointer(devices[indx]) lengths[indx].write_size_t(binaries[indx].bytesize) p = MemoryPointer::new(binaries[indx].bytesize) p.write_bytes(binaries[indx]) binaries_p[indx].write_pointer(p) } binary_status = MemoryPointer::new( :cl_int, num_devices ) error = MemoryPointer::new( :cl_int ) prog = clCreateProgramWithBinary(context, num_devices, devices_p, lengths, binaries_p, binary_status, error) error_check(error.read_cl_int) d_s = [] num_devices.times { |indx| d_s.push [ devices[indx], binary_status[indx].read_cl_int ] } return [ Program::new(prog, false), d_s ] end |
.create_program_with_built_in_kernels(context, device_list, kernel_names) ⇒ Object
Creates a Program from a list of built in kernel names
Attributes
-
context
- Context the created Program will be associated to -
device_list
- an Array of Device to create the program for -
kernel_names
- a single or an Array of String representing the kernel names
129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 129 def self.create_program_with_built_in_kernels(context, device_list, kernel_names) devices = [device_list].flatten num_devices = devices.length devices_p = MemoryPointer::new( Device, num_devices ) num_devices.times { |indx| devices_p[indx].write_pointer(devices[indx]) } names = [kernel_names].flatten.join(",") names_p = MemoryPointer.from_string(names) error = MemoryPointer::new( :cl_int ) prog = clCreateProgramWithBuiltInKernels( context, num_devices, devices_p, names_p, error ) error_check(error.read_cl_int) return Program::new(prog, false) end |
.create_program_with_il(context, il) ⇒ Object
Create a Program from an intermediate level representation
Attributes
-
context
- Context the created Program will be associated to -
il
- a binary string containing the intermediate level representation of the program
219 220 221 222 223 224 225 226 227 228 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 219 def self.create_program_with_il(context, il) error_check(INVALID_OPERATION) if context.platform.version_number < 2.1 length = il.bytesize il_p = MemoryPointer::new( length ) error = MemoryPointer::new( :cl_int ) il_p.write_bytes(il) program_ptr = clCreateProgramWithIL(context, il_p, length, error) error_check(error.read_cl_int) return Program::new( program_ptr, false ) end |
.create_program_with_source(context, strings) ⇒ Object
Creates a Program from sources
Attributes
-
context
- Context the created Program will be associated to -
strings
- a single or an Array of String repesenting the program source code
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 183 def self.create_program_with_source(context, strings) strs = nil if not strings then error_check(INVALID_VALUE) else strs = [strings].flatten end n_strs = strs.size c_strs = MemoryPointer::new( :pointer, n_strs ) c_strs_p = [] strs.each { |str| if str then c_strs_p.push (MemoryPointer.from_string(str)) end } error_check(INVALID_VALUE) if c_strs_p.size == 0 c_strs = MemoryPointer::new( :pointer, c_strs_p.size ) c_strs_length = MemoryPointer::new( :size_t, c_strs_p.size ) c_strs_p.each_with_index { |p, i| c_strs[i].write_pointer(p) c_strs_length[i].write_size_t(p.size == 0 ? 0 : p.size - 1) # minus the null character } error = MemoryPointer::new( :cl_int ) program_ptr = clCreateProgramWithSource(context, c_strs_p.size, c_strs, c_strs_length, error) error_check(error.read_cl_int) return Program::new( program_ptr, false ) end |
.create_sampler(context, options = {}) ⇒ Object
Creates a Sampler
Attributes
-
context
- Context the created Sampler will be associated to
Options
-
:normalized_coords
- a :cl_bool specifying if the image coordinates are normalized -
:addressing_mode
- a :cl_addressing_mode specifying how out-of-range image coordinates are handled when reading from an image -
:filter_mode
- a :cl_filter_mode specifying the type of filter that must be applied when reading an image -
:mip_filter_mode
- the filtering mode to use if using mimaps (default CL_FILTER_NONE, requires cl_khr_mipmap_image) -
:lod_min
- floating point value representing the minimal LOD (default 0.0f, requires cl_khr_mipmap_image) -
:lod_max
- floating point value representing the maximal LOD (default MAXFLOAT, requires cl_khr_mipmap_image)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 18 def self.create_sampler( context, = {} ) normalized_coords = TRUE normalized_coords = [:normalized_coords] if [:normalized_coords] addressing_mode = AddressingMode::CLAMP addressing_mode = [:addressing_mode] if [:addressing_mode] filter_mode = FilterMode::NEAREST filter_mode = [:filter_mode] if [:filter_mode] error = MemoryPointer::new( :cl_int ) if context.platform.version_number < 2.0 then sampler_ptr = clCreateSampler( context, normalized_coords, addressing_mode, filter_mode, error ) else prop_size = 7 prop_size += 2 if [:mip_filter_mode] prop_size += 2 if [:lod_min] prop_size += 2 if [:lod_max] properties = MemoryPointer::new( :cl_sampler_properties, prop_size ) properties[0].write_cl_sampler_info( Sampler::NORMALIZED_COORDS ) properties[1].write_cl_bool( normalized_coords ) properties[2].write_cl_sampler_info( Sampler::ADDRESSING_MODE ) properties[3].write_cl_addressing_mode( addressing_mode ) properties[4].write_cl_sampler_info( Sampler::FILTER_MODE ) properties[5].write_cl_filter_mode( filter_mode ) prop_indx = 6 if [:mip_filter_mode] then properties[prop_indx].write_cl_sampler_info( Sampler::MIP_FILTER_MODE ) properties[prop_indx+1].write_cl_filter_mode( [:mip_filter_mode] ) prop_indx += 2 end if [:lod_min] then properties[prop_indx].write_cl_sampler_info( Sampler::LOD_MIN ) properties[prop_indx+1].write_float( [:lod_min] ) prop_indx += 2 end if [:lod_max] then properties[prop_indx].write_cl_sampler_info( Sampler::LOD_MAX ) properties[prop_indx+1].write_float( [:lod_max] ) prop_indx += 2 end properties[prop_indx].write_cl_sampler_info( 0 ) sampler_ptr = clCreateSamplerWithProperties( context, properties, error ) end error_check(error.read_cl_int) Sampler::new(sampler_ptr, false) end |
.create_sub_buffer(buffer, type, info, options = {}) ⇒ Object
Creates a Buffer from a sub part of an existing Buffer
Attributes
-
buffer
- source Buffer -
type
- type of sub-buffer to create. Only OpenCL::BUFFER_CREATE_TYPE_REGION is supported for now -
info
- inf reguarding the type of sub-buffer created. if type == OpenCL::BUFFER_CREATE_TYPE_REGION, info is a BufferRegion -
options
- a hash containing named options
Options
-
:flags
- a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Buffer
43 44 45 46 47 48 49 50 |
# File 'lib/opencl_ruby_ffi/Buffer.rb', line 43 def self.create_sub_buffer( buffer, type, info, = {} ) error_check(INVALID_OPERATION) if buffer.platform.version_number < 1.1 flags = get_flags( ) error = MemoryPointer::new( :cl_int ) buff = clCreateSubBuffer( buffer, flags, type, info, error) error_check(error.read_cl_int) return Buffer::new( buff, false ) end |
.create_sub_devices(in_device, properties) ⇒ Object
Splits a Device in serveral sub-devices
Attributes
-
in_device
- the Device to be partitioned -
properties
- an Array of cl_device_partition_property
Returns
an Array of Device
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/opencl_ruby_ffi/Device.rb', line 14 def self.create_sub_devices( in_device, properties ) error_check(INVALID_OPERATION) if in_device.platform.version_number < 1.2 props = MemoryPointer::new( :cl_device_partition_property, properties.length + 1 ) properties.each_with_index { |e, i| props[i].write_cl_device_partition_property(e) } props[properties.length].write_cl_device_partition_property(0) device_number_ptr = MemoryPointer::new( :cl_uint ) error = clCreateSubDevices( in_device, props, 0, nil, device_number_ptr ) error_check(error) device_number = device_number_ptr.read_cl_uint devices_ptr = MemoryPointer::new( Device, device_number ) error = clCreateSubDevices( in_device, props, device_number, devices_ptr, nil ) error_check(error) devices_ptr.get_array_of_pointer(0, device_number).collect { |device_ptr| Device::new(device_ptr, false) } end |
.create_sub_devices_ext(in_device, properties) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/opencl_ruby_ffi/ext/device_fission.rb', line 51 def self.create_sub_devices_ext( in_device, properties ) error_check(INVALID_OPERATION) if in_device.platform.version_number < 1.1 and not in_device.platform.extensions.include? "cl_ext_device_fission" props = MemoryPointer::new( :cl_device_partition_property_ext, properties.length + 1 ) properties.each_with_index { |e,i| props[i].write_cl_device_partition_property_ext(e) } props[properties.length].write_cl_device_partition_property_ext(0) device_number_ptr = MemoryPointer::new( :cl_uint ) error = clCreateSubDevicesEXT( in_device, props, 0, nil, device_number_ptr ) error_check(error) device_number = device_number_ptr.read_cl_uint devices_ptr = MemoryPointer::new( Device, device_number ) error = clCreateSubDevicesEXT( in_device, props, device_number, devices_ptr, nil ) error_check(error) devices_ptr.get_array_of_pointer(0, device_number).collect { |device_ptr| Device::new(device_ptr, false) } end |
.create_user_event(context) ⇒ Object
Creates a user Event
Attributes
-
context
- Context the created Event will be associated to
40 41 42 43 44 45 46 |
# File 'lib/opencl_ruby_ffi/Event.rb', line 40 def self.create_user_event(context) error_check(INVALID_OPERATION) if context.platform.version_number < 1.1 error = MemoryPointer::new(:cl_int) event = clCreateUserEvent(context, error) error_check(error.read_cl_int) return Event::new(event, false) end |
.enqueue_acquire_gl_objects(command_queue, mem_objects, options = {}) ⇒ Object Also known as: enqueue_acquire_GL_objects
Acquire OpenCL Mem objects that have been created from OpenGL objects
Attributes
-
command_queue
- CommandQueue used to execute the acquire command -
mem_objects
- a single or an Array of Mem objects -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 564 def self.enqueue_acquire_gl_objects( command_queue, mem_objects, = {} ) num_objs = [mem_objects].flatten.length objs = nil if num_objs > 0 then objs = MemoryPointer::new( Mem, num_objs ) [mem_objects].flatten.each_with_index { |e, i| objs[i].write_pointer(e) } end num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueAcquireGLObjects( command_queue, num_objs, objs, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_barrier(command_queue, events = []) ⇒ Object
Enqueues a barrier that prevents subsequent execution to take place in the command queue, until the barrier is considered finished
Attributes
-
command_queue
- CommandQueue used to execute the command -
events
- an optional single or Array of Event to wait upon before the barrier is considered finished
Returns
an Event if implementation version is >= 1.2, nil otherwise
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1004 def self.( command_queue, events = [] ) if command_queue.device.platform.version_number < 1.2 then num_events = [events].flatten.length if num_events > 0 then evts = MemoryPointer::new( Event, num_events ) [events].flatten.each_with_index { |e, i| evts[i].write_pointer(e) } error = clnqueueWaitForEvents( command_queue, num_events, evts ) else error = clEnqueueBarrier( command_queue ) end error_check(error) return nil else num_events = [events].flatten.length evts = nil if num_events > 0 then evts = MemoryPointer::new( Event, num_events ) [events].flatten.each_with_index { |e, i| evts[i].write_pointer(e) } end event = MemoryPointer::new( Event ) error = clEnqueueBarrierWithWaitList( command_queue, num_events, evts, event ) error_check(error) return Event::new(event.read_pointer, false) end end |
.enqueue_copy_buffer(command_queue, src_buffer, dst_buffer, options = {}) ⇒ Object
Enqueues a command to copy data from a Buffer object into another Buffer object
Attributes
-
command_queue
- CommandQueue used to execute the write command -
src_buffer
- the Buffer to be read from -
dst_buffer
- the Buffer to be written to -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:src_offset
- if provided indicates the offset inside the src Buffer of the area to copy, else 0 -
:dst_offset
- if provided indicates the offset inside the dst Buffer of the area to write to, else 0 -
:size
- if provided indicates the size of data to copy, else the maximum possible is copied
Returns
the Event associated with the command
466 467 468 469 470 471 472 473 474 475 476 477 478 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 466 def self.enqueue_copy_buffer(command_queue, src_buffer, dst_buffer, = {}) src_offset = 0 src_offset = [:src_offset] if [:src_offset] dst_offset = 0 dst_offset = [:dst_offset] if [:dst_offset] size = [ src_buffer.size - src_offset, dst_buffer.size - dst_offset ].min size = [:size] if [:size] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueCopyBuffer(command_queue, src_buffer, dst_buffer, src_offset, dst_offset, size, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_copy_buffer_rect(command_queue, src_buffer, dst_buffer, region, options = {}) ⇒ Object
Enqueues a command to copy a rectangular region into a Buffer object from another Buffer object
Attributes
-
command_queue
- CommandQueue used to execute the write command -
src_buffer
- the Buffer to be read from -
dst_buffer
- the Buffer to be written to -
region
- the region to write in the Buffer -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:src_origin
- if provided indicates the origin inside the src Buffer of the area to copy, else [0, 0, 0] -
:dst_origin
- if provided indicates the origin inside the dst Buffer of the area to write to, else [0, 0, 0] -
:src_row_pitch
- if provided indicates the row pitch inside the src Buffer, else 0 -
:src_slice_pitch
- if provided indicates the slice pitch inside the src Buffer, else 0 -
:dst_row_pitch
- if provided indicates the row pitch inside the dst Buffer, else 0 -
:dst_slice_pitch
- if provided indicates the slice pitch inside the dst Buffer area, else 0
Returns
the Event associated with the command
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 399 def self.enqueue_copy_buffer_rect(command_queue, src_buffer, dst_buffer, region, = {}) error_check(INVALID_OPERATION) if command_queue.device.platform.version_number < 1.1 src_origin = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| src_origin[i].write_size_t(0) } if [:src_origin] then [:src_origin].each_with_index { |e, i| src_origin[i].write_size_t(e) } end dst_origin = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| dst_origin[i].write_size_t(0) } if [:dst_origin] then [:dst_origin].each_with_index { |e, i| dst_origin[i].write_size_t(e) } end r = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| r[i].write_size_t(0) } region[0..2].each_with_index { |e, i| r[i].write_size_t(e) } src_row_pitch = [:src_row_pitch] if not src_row_pitch then src_row_pitch = 0 end src_slice_pitch = [:src_slice_pitch] if not src_slice_pitch then src_slice_pitch = 0 end dst_row_pitch = [:dst_row_pitch] if not dst_row_pitch then dst_row_pitch = 0 end dst_slice_pitch = [:dst_slice_pitch] if not dst_slice_pitch then dst_slice_pitch = 0 end num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueCopyBufferRect(command_queue, src_buffer, dst_buffer, src_origin, dst_origin, r, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_copy_buffer_to_image(command_queue, src_buffer, dst_image, options = {}) ⇒ Object
Enqueues a command to copy a Buffer into an Image
Attributes
-
command_queue
- CommandQueue used to execute the copy command -
src_buffer
- the Buffer to be read from -
dst_image
- the Image to be written to -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:dst_origin
- if provided indicates the origin of the region to write into the Image, else [0, 0, 0] -
:region
- if provided indicates the dimension of the region to copy, else the maximum region is copied -
:src_offset
- if provided indicates the offset inside the Buffer, else 0
Returns
the Event associated with the command
729 730 731 732 733 734 735 736 737 738 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 729 def self.enqueue_copy_buffer_to_image(command_queue, src_buffer, dst_image, = {}) dst_origin, region = get_origin_region( dst_image, , :dst_origin, :region ) src_offset = 0 src_offset = [:src_offset] if [:src_offset] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueCopyBufferToImage( command_queue, src_buffer, dst_image, src_offset, dst_origin, region, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_copy_image(command_queue, src_image, dst_image, options = {}) ⇒ Object
Enqueues a command to copy from an Image into an Image
Attributes
-
command_queue
- CommandQueue used to execute the copy command -
src_image
- the Image to be written to -
dst_image
- the Image to be written to -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:src_origin
- if provided indicates the origin of the region to read into the src Image, else [0, 0, 0] -
:dst_origin
- if provided indicates the origin of the region to write into the dst Image, else [0, 0, 0] -
:region
- if provided indicates the dimension of the region to copy, else the maximum region is copied
Returns
the Event associated with the command
798 799 800 801 802 803 804 805 806 807 808 809 810 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 798 def self.enqueue_copy_image( command_queue, src_image, dst_image, = {} ) src_origin, src_region = get_origin_region( src_image, , :src_origin, :region ) dst_origin, dst_region = get_origin_region( dst_image, , :dst_origin, :region ) region = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| region[i].write_size_t( [src_region[i].read_size_t, dst_region[i].read_size_t].min ) } num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueCopyImage( command_queue, src_image, dst_image, src_origin, dst_origin, region, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_copy_image_to_buffer(command_queue, src_image, dst_buffer, options = {}) ⇒ Object
Enqueues a command to copy an Image into a Buffer
Attributes
-
command_queue
- CommandQueue used to execute the copy command -
src_image
- the Image to be read from -
dst_buffer
- the Buffer to be written to -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:src_origin
- if provided indicates the origin of the region to copy from the Image, else [0, 0, 0] -
:region
- if provided indicates the dimension of the region to copy, else the maximum region is copied -
:dst_offset
- if provided indicates the offset inside the Buffer, else 0
Returns
the Event associated with the command
699 700 701 702 703 704 705 706 707 708 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 699 def self.enqueue_copy_image_to_buffer( command_queue, src_image, dst_buffer, = {} ) src_origin, region = get_origin_region( src_image, , :src_origin, :region ) dst_offset = 0 dst_offset = [:dst_offset] if [:dst_offset] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueCopyImageToBuffer( command_queue, src_image, dst_buffer, src_origin, region, dst_offset, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_fill_buffer(command_queue, buffer, pattern, options = {}) ⇒ Object
Enqueues a command to fill a Buffer with the given pattern
Attributes
-
command_queue
- CommandQueue used to execute the fill command -
buffer
- a Buffer object to be filled -
pattern
- the Pointer (or convertible to Pointer using to_ptr) to the memory area where the pattern is stored -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:offset
- if provided indicates the offset inside the Buffer of the area to be filled, else 0 -
:size
- if provided indicates the size of data to fill, else the maximum size is filled -
:pattern_size
- if provided indicates the size of the pattern, else the maximum pattern data is used
Returns
the Event associated with the command
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 636 def self.enqueue_fill_buffer( command_queue, buffer, pattern, = {} ) error_check(INVALID_OPERATION) if command_queue.device.platform.version_number < 1.1 offset = 0 offset = [:offset] if [:offset] pattern_size = pattern.size pattern_size = [:pattern_size] if [:pattern_size] size = (buffer.size - offset) size -= size % pattern_size size = [:size] if [:size] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueFillBuffer( command_queue, buffer, pattern, pattern_size, offset, size, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_fill_image(command_queue, image, fill_color, options = {}) ⇒ Object
Enqueues a command to fill an Image with the given color
Attributes
-
command_queue
- CommandQueue used to execute the fill command -
image
- an Image object to be filled -
fill_color
- the Pointer (or convertible to Pointer using to_ptr) to the memory area where the color is stored -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:origin
- if provided indicates the origin of the region to fill inside the Image, else [0, 0, 0] -
:region
- if provided indicates the dimension of the region to fill, else the maximum region is filled
Returns
the Event associated with the command
670 671 672 673 674 675 676 677 678 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 670 def self.enqueue_fill_image( command_queue, image, fill_color, = {} ) error_check(INVALID_OPERATION) if command_queue.device.platform.version_number < 1.1 origin, region = get_origin_region( image, , :origin, :region ) num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueFillImage( command_queue, image, fill_color, origin, region, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_map_buffer(command_queue, buffer, map_flags, options = {}) ⇒ Object
Enqueues a command to map aa Buffer into host memory
Attributes
-
command_queue
- CommandQueue used to execute the map command -
buffer
- the Buffer object to map -
map_flags
- a single or an Array of :cl_map_flags flags -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_map
- if provided indicates if the command blocks until the region is mapped -
:blocking
- if provided indicates if the command blocks until the region is mapped -
:offset
- if provided the offset inside the Buffer region to map, else 0 -
:size
- if provided the size of the region in the Buffer to map, else the largest possible size is used
Returns
an Array composed of [event, pointer] where:
-
event
- the Event associated with the command -
pointer
- a Pointer to the mapped memory region
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 180 def self.enqueue_map_buffer( command_queue, buffer, map_flags, = {} ) blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_map] flags = get_flags( {:flags => map_flags} ) offset = 0 offset = [:offset] if [:offset] size = buffer.size - offset size = [:size] if [:size] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = MemoryPointer::new( :cl_int ) ptr = clEnqueueMapBuffer( command_queue, buffer, blocking, flags, offset, size, num_events, events, event, error ) error_check( error.read_cl_int ) ev = Event::new( event.read_pointer, false ) return [ev, ptr.slice(0, size)] end |
.enqueue_map_image(command_queue, image, map_flags, options = {}) ⇒ Object
Enqueues a command to map an Image into host memory
Attributes
-
command_queue
- CommandQueue used to execute the map command -
image
- the Image object to map -
map_flags
- a single or an Array of :cl_map_flags flags -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_map
- if provided indicates if the command blocks until the region is mapped -
:blocking
- if provided indicates if the command blocks until the region is mapped -
:origin
- if provided the origin in the Image of the region to map, else [0, 0, 0] -
:region
- if provided the region in the image to map, else the largest possible area is used
Returns
an Array composed of [event, pointer, image_row_pitch, image_slice_pitch] where:
-
event
- the Event associated with the command -
pointer
- a Pointer to the mapped memory region -
image_row_pitch
- the row pitch of the mapped region -
image_slice_pitch
- the slice pitch of the mapped region
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 129 def self.enqueue_map_image( command_queue, image, map_flags, = {} ) blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_map] flags = get_flags( {:flags => map_flags} ) origin, region = get_origin_region( image, , :origin, :region ) num_events, events = get_event_wait_list( ) image_row_pitch = MemoryPointer::new( :size_t ) image_slice_pitch = MemoryPointer::new( :size_t ) event = MemoryPointer::new( Event ) error = MemoryPointer::new( :cl_int ) ptr = clEnqueueMapImage( command_queue, image, blocking, flags, origin, region, image_row_pitch, image_slice_pitch, num_events, events, event, error ) error_check( error.read_cl_int ) ev = Event::new( event.read_pointer, false ) size = nil image_row_pitch = image_row_pitch.read_size_t image_slice_pitch = image_slice_pitch.read_size_t case image.type when Mem::IMAGE1D_ARRAY, Mem::IMAGE1D_BUFFER, Mem::IMAGE1D size = region[0].read_size_t*image.pixel_size when Mem::IMAGE2D, Mem::IMAGE2D_ARRAY size = region[1].read_size_t*image_row_pitch when Mem::IMAGE3D size = region[2].read_size_t*image_slice_pitch end return [ev, ptr.slice(0,size), image_row_pitch, image_slice_pitch] end |
.enqueue_marker(command_queue, events = []) ⇒ Object
Enqueues a marker
Attributes
-
command_queue
- CommandQueue used to execute the command -
events
- an optional single or Array of Event to wait upon before the marker is considered finished, if not provided all previous command are waited for before the marker is considered finished (unavailable if implementation version < 1.2 )
Returns
an Event
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 1044 def self.enqueue_marker( command_queue, events = [] ) event = MemoryPointer::new( Event ) if command_queue.device.platform.version_number < 1.2 then error = clEnqueueMarker( command_queue, event ) else num_events = [events].flatten.length evts = nil if num_events > 0 then evts = MemoryPointer::new( Event, num_events ) [events].flatten.each_with_index { |e, i| evts[i].write_pointer(e) } end error = clEnqueueMarkerWithWaitList( command_queue, num_events, evts, event ) end error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_migrate_mem_objects(command_queue, mem_objects, options = {}) ⇒ Object
Enqueues a command to indicate which device a set of memory objects should be migrated to
Attributes
-
command_queue
- objects will be migrated to the device associated with this CommandQueue -
mem_objects
- the Mem objects to migrate -
options
- a hash containing named options
Options
-
:flags
- a single or an Array of :cl_mem_migration flags -
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 87 def self.enqueue_migrate_mem_objects( command_queue, mem_objects, = {} ) error_check(INVALID_OPERATION) if command_queue.device.platform.version_number < 1.2 num_mem_objects = [mem_objects].flatten.length mem_list = nil if num_mem_objects > 0 then mem_list = MemoryPointer::new( Mem, num_mem_objects ) [mem_objects].flatten.each_with_index { |e, i| mem_list[i].write_pointer(e) } end flags = get_flags( ) num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueMigrateMemObjects( command_queue, num_mem_objects, mem_list, flags, num_events, events, event ) error_check( error ) return Event::new( event.read_pointer, false ) end |
.enqueue_native_kernel(command_queue, options = {}, &func) ⇒ Object
Enqueues a native kernel
Attributes
-
command_queue
- CommandQueue used to execute the command -
options
- a hash containing named options -
func
- a Proc object to execute
Options
-
:args
- if provided, a list of arguments to pass to the kernel. Arguments should have a size method and be convertible to Pointer with to_ptr -
:mem_list
- if provided, a hash containing Buffer objects and their index inside the argument list. -
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 867 def self.enqueue_native_kernel( command_queue, = {}, &func ) arguments = [:args] arg_offset = [] args = nil args_size = 0 if arguments then [arguments].flatten.each { |e| arg_offset.push(arg_size) args_size += e.size } args = MemoryPointer::new(args_size) [arguments].flatten.each_with_index { |e, i| args.put_bytes(arg_offset[i], e.to_ptr.read_bytes(e.size)) } end num_mem_objects = 0 mem_list = nil if [:mem_list] then num_mem_objects = [:mem_list].length if num_mem_objects > 0 then mem_list = MemoryPointer::new( Mem, num_mem_objects ) mem_loc = MemoryPointer::new( :pointer, num_mem_objects ) i = 0 [:mem_list].each { |key, value| mem_list[i].write_pointer(key) mem_loc[i].write_pointer(args+arg_offset[value]) i = i + 1 } end end num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueNativeKernel( command_queue, func, args, args_size, num_mem_objects, mem_list, mem_loc, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_ndrange_kernel(command_queue, kernel, global_work_size, options = {}) ⇒ Object Also known as: enqueue_NDrange_kernel
Enqueues a kernel as a ndrange
Attributes
-
command_queue
- CommandQueue used to execute the command -
kernel
- a Kernel object to execute -
global_work_size
- dimensions of the work -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:local_work_size
- if provided, dimensions of the local work group size -
:global_work_offset
- if provided, offset inside the global work size
Returns
the Event associated with the command
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 951 def self.enqueue_ndrange_kernel( command_queue, kernel, global_work_size, ={} ) gws = MemoryPointer::new( :size_t, global_work_size.length ) global_work_size.each_with_index { |g, i| gws[i].write_size_t(g) } lws = nil if [:local_work_size] then lws = MemoryPointer::new( :size_t, global_work_size.length ) global_work_size.each_index { |i| lws[i].write_size_t([:local_work_size][i]) } end gwo = nil if [:global_work_offset] then gwo = MemoryPointer::new( :size_t, global_work_size.length ) global_work_size.each_index { |i| gwo[i].write_size_t([:global_work_offset][i]) } end num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueNDRangeKernel(command_queue, kernel, global_work_size.length, gwo, gws, lws, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_read_buffer(command_queue, buffer, ptr, options = {}) ⇒ Object
Enqueues a command to read from a Buffer object to host memory
Attributes
-
command_queue
- CommandQueue used to execute the read command -
buffer
- the Buffer to be read from -
ptr
- the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_read
- if provided indicates if the command blocks until the region is read -
:blocking
- if provided indicates if the command blocks until the region is read -
:offset
- if provided indicates the offset inside the Buffer of the area to read from, else 0 -
:size
- if provided indicates the size of data to copy, else the maximum data is copied
Returns
the Event associated with the command
535 536 537 538 539 540 541 542 543 544 545 546 547 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 535 def self.enqueue_read_buffer( command_queue, buffer, ptr, = {} ) blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_read] offset = 0 offset = [:offset] if [:offset] size = buffer.size - offset size = [:size] if [:size] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueReadBuffer(command_queue, buffer, blocking, offset, size, ptr, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_read_buffer_rect(command_queue, buffer, ptr, region, options = {}) ⇒ Object
Enqueues a command to read from a rectangular region from a Buffer object to host memory
Attributes
-
command_queue
- CommandQueue used to execute the read command -
buffer
- the Buffer to be read from -
ptr
- the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
region
- the region in the Buffer to copy -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_read
- if provided indicates if the command blocks until the region is read -
:blocking
- if provided indicates if the command blocks until the region is read -
:buffer_origin
- if provided indicates the origin inside the buffer of the area to copy, else [0, 0, 0] -
:host_origin
- if provided indicates the origin inside the target host area, else [0, 0, 0] -
:buffer_row_pitch
- if provided indicates the row pitch inside the buffer, else 0 -
:buffer_slice_pitch
- if provided indicates the slice pitch inside the buffer, else 0 -
:host_row_pitch
- if provided indicates the row pitch inside the host area, else 0 -
:host_slice_pitch
- if provided indicates the slice pitch inside the host area, else 0
Returns
the Event associated with the command
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 247 def self.enqueue_read_buffer_rect( command_queue, buffer, ptr, region, = {} ) error_check(INVALID_OPERATION) if command_queue.device.platform.version_number < 1.1 blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_read] buffer_origin = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| buffer_origin[i].write_size_t(0) } bo = [:src_origin] ? [:src_origin] : [:buffer_origin] if bo then bo.each_with_index { |e, i| buffer_origin[i].write_size_t(e) } end host_origin = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| host_origin[i].write_size_t(0) } ho = [:dst_origin] ? [:dst_origin] : [:host_origin] if ho then ho.each_with_index { |e, i| host_origin[i].write_size_t(e) } end r = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| r[i].write_size_t(0) } region[0..2].each_with_index { |e, i| r[i].write_size_t(e) } buffer_row_pitch = [:src_row_pitch] ? [:src_row_pitch] : [:buffer_row_pitch] if not buffer_row_pitch then buffer_row_pitch = 0 end buffer_slice_pitch = [:src_slice_pitch] ? [:src_slice_pitch] : [:buffer_slice_pitch] if not buffer_slice_pitch then buffer_slice_pitch = 0 end host_row_pitch = [:dst_row_pitch] ? [:dst_row_pitch] : [:host_row_pitch] if not host_row_pitch then host_row_pitch = 0 end host_slice_pitch = [:dst_slice_pitch] ? [:dst_slice_pitch] : [:host_slice_pitch] if not host_slice_pitch then host_slice_pitch = 0 end num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueReadBufferRect(command_queue, buffer, blocking, buffer_origin, host_origin, r, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_read_image(command_queue, image, ptr, options = {}) ⇒ Object
Enqueues a command to copy from an Image into host memory
Attributes
-
command_queue
- CommandQueue used to execute the read command -
image
- the Image to be written to -
ptr
- the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_read
- if provided indicates if the command blocks until the region is read. -
:blocking
- if provided indicates if the command blocks until the region is read -
:origin
- if provided indicates the origin of the region to read from the Image, else [0, 0, 0] -
:region
- if provided indicates the dimension of the region to copy, else the maximum region is copied -
:row_pitch
- if provided indicates the row pitch inside the host area, else 0 -
:slice_pitch
- if provided indicates the slice pitch inside the host area, else 0
Returns
the Event associated with the command
834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 834 def self.enqueue_read_image( command_queue, image, ptr, = {} ) blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_read] origin, region = get_origin_region( image, , :origin, :region ) row_pitch = 0 row_pitch = [:row_pitch] if [:row_pitch] slice_pitch = 0 slice_pitch = [:slice_pitch] if [:slice_pitch] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueReadImage( command_queue, image, blocking, origin, region, row_pitch, slice_pitch, ptr, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_release_gl_objects(command_queue, mem_objects, options = {}) ⇒ Object Also known as: enqueue_release_GL_objects
Release OpenCL Mem objects that have been created from OpenGL objects and previously acquired
Attributes
-
command_queue
- CommandQueue used to execute the release command -
mem_objects
- a single or an Array of Mem objects -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 598 def self.enqueue_release_gl_objects( command_queue, mem_objects, = {} ) num_objs = [mem_objects].flatten.length objs = nil if num_objs > 0 then objs = MemoryPointer::new( Mem, num_objs ) [mem_objects].flatten.each_with_index { |e, i| objs[i].write_pointer(e) } end num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueReleaseGLObjects( command_queue, num_objs, objs, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_svm_free(command_queue, svm_pointers, options = {}, &block) ⇒ Object
Enqueues a command that frees SVMPointers (or Pointers using a callback)
Attributes
-
command_queue
- CommandQueue used to execute the write command -
svm_pointer
- a single or an Array of SVMPointer (or Pointer) -
options
- a hash containing named options -
block
- if provided, a callback invoked to free the pointers. Signature of the callback is { |CommandQueue, num_pointers, Pointer to an array of num_pointers Pointers, Pointer to user_data| … }
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:user_data
- if provided, a Pointer (or convertible to using to_ptr) that will be passed to the callback
Returns
the Event associated with the command
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 97 def self.enqueue_svm_free(command_queue, svm_pointers, = {}, &block) error_check(INVALID_OPERATION) if command_queue.context.platform.version_number < 2.0 pointers = [svm_pointers].flatten num_pointers = pointers.length ptr = MemoryPointer::new( :pointer, num_pointers) pointers.each_with_index { |p, indx| ptr[indx].write_pointer(p) } num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueSVMFree(command_queue, num_pointers, ptr, block, [:user_data], num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_svm_map(command_queue, svm_ptr, map_flags, options = {}) ⇒ Object
Enqueues a command to map an Image into host memory
Attributes
-
command_queue
- CommandQueue used to execute the map command -
svm_ptr
- the SVMPointer to the area to map -
map_flags
- a single or an Array of :cl_map_flags flags -
options
- a hash containing named options
Options
-
:size
- the size of the region to map -
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_map
- if provided indicates if the command blocks until the region is mapped -
:blocking
- if provided indicates if the command blocks until the region is mapped
Returns
the Event associated with the command
195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 195 def self.enqueue_svm_map( command_queue, svm_ptr, map_flags, = {} ) error_check(INVALID_OPERATION) if command_queue.context.platform.version_number < 2.0 blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_map] flags = get_flags( {:flags => map_flags} ) size = svm_ptr.size size = [:size] if [:size] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueSVMMap( command_queue, blocking, flags, svm_ptr, size, num_events, events, event ) error_check( error.read_cl_int ) return Event::new( event.read_pointer, false ) end |
.enqueue_svm_memcpy(command_queue, dst_ptr, src_ptr, options = {}) ⇒ Object
Enqueues a command to copy from or to an SVMPointer
Attributes
-
command_queue
- CommandQueue used to execute the write command -
dst_ptr
- the Pointer (or convertible to Pointer using to_ptr) or SVMPointer to be written to -
src_ptr
- the Pointer (or convertible to Pointer using to_ptr) or SVMPointer to be read from -
options
- a hash containing named options
Options
-
:size
- the size of data to copy -
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_copy
- if provided indicates if the command blocks until the copy finishes -
:blocking
- if provided indicates if the command blocks until the copy finishes
Returns
the Event associated with the command
131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 131 def self.enqueue_svm_memcpy(command_queue, dst_ptr, src_ptr, = {}) error_check(INVALID_OPERATION) if command_queue.context.platform.version_number < 2.0 blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_copy] size = [dst_ptr.size, src_ptr.size].min size = [:size] if [:size] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueSVMMemcpy(command_queue, blocking, dst_ptr, src_ptr, size, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_svm_memfill(command_queue, svm_ptr, pattern, options = {}) ⇒ Object
Enqueues a command to fill a an SVM memory area
Attributes
-
command_queue
- CommandQueue used to execute the write command -
svm_ptr
- the SVMPointer to the area to fill -
pattern
- the Pointer (or convertible to Pointer using to_ptr) to the memory area where the pattern is stored
Options
-
:size
- the size of the area to fill -
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:pattern_size
- if provided indicates the size of the pattern, else the maximum pattern data is used
Returns
the Event associated with the command
161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 161 def self.enqueue_svm_memfill(command_queue, svm_ptr, pattern, = {}) error_check(INVALID_OPERATION) if command_queue.context.platform.version_number < 2.0 num_events, events = get_event_wait_list( ) pattern_size = pattern.size pattern_size = [:pattern_size] if [:pattern_size] size = svm_ptr.size size = [:size] if [:size] event = MemoryPointer::new( Event ) error = clEnqueueSVMMemFill(command_queue, svm_ptr, pattern, pattern_size, size, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_svm_migrate_mem(command_queue, svn_ptrs, options = {}) ⇒ Object
Enqueues a command to migrate SVM memory area
Attributes
-
command_queue
- CommandQueue used to execute the unmap command -
svm_ptrs
- a single or an Array of SVM memory area to migrate -
options
- a hash containing named options
Options
-
:sizes
- a single or an Array of sizes to transfer -
:flags
- a single or an Array of :cl_mem_migration flags -
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 249 def self.enqueue_svm_migrate_mem( command_queue, svn_ptrs, = {} ) error_check(INVALID_OPERATION) if command_queue.context.platform.version_number < 2.1 svn_ptrs = [svn_ptrs].flatten num_svm_pointers = svn_ptrs.length num_events, events = get_event_wait_list( ) flags = get_flags( ) sizes = [0]*num_svm_pointers sizes = [:sizes] if [:sizes] svn_ptrs_p = MemoryPointer::new( :pointer, num_svm_pointers) svn_ptrs.each_with_index { |e, i| svn_ptrs_p[i].write_pointer(e) } sizes_p = MemoryPointer::new( :size_t, num_svm_pointers) num_svm_pointers.times { |i| sizes_p[i].write_size_t(sizes[i]) } event = MemoryPointer::new( Event ) error = clEnqueueSVMMigrateMem( command_queue, num_svm_pointers, svn_ptrs_p, sizes_p, flags, num_events, events, event ) error_check( error ) return Event::new( event.read_pointer, false ) end |
.enqueue_svm_unmap(command_queue, svm_ptr, options = {}) ⇒ Object
Enqueues a command to unmap a previously mapped SVM memory area
Attributes
-
command_queue
- CommandQueue used to execute the unmap command -
svm_ptr
- the SVMPointer of the area to be unmapped -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
224 225 226 227 228 229 230 231 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 224 def self.enqueue_svm_unmap( command_queue, svm_ptr, = {} ) error_check(INVALID_OPERATION) if command_queue.context.platform.version_number < 2.0 num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueSVMUnmap( command_queue, svm_ptr, num_events, events, event ) error_check( error ) return Event::new( event.read_pointer, false ) end |
.enqueue_task(command_queue, kernel, options = {}) ⇒ Object
Enqueues a kernel as a task
Attributes
-
command_queue
- CommandQueue used to execute the command -
kernel
- a Kernel object to execute -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
919 920 921 922 923 924 925 926 927 928 929 930 931 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 919 def self.enqueue_task( command_queue, kernel, = {} ) if command_queue.device.platform.version_number < 2.0 then num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueTask( command_queue, kernel, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) else opts = .dup opts[:local_work_size] = [1] return enqueue_ndrange_kernel( command_queue, kernel, [1], opts ) end end |
.enqueue_unmap_mem_object(command_queue, mem_obj, mapped_ptr, options = {}) ⇒ Object
Enqueues a command to unmap a previously mapped region of a memory object
Attributes
-
command_queue
- CommandQueue used to execute the unmap command -
mem_obj
- the Mem object that was previously mapped -
mapped_ptr
- the Pointer previously returned by a map command -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command
Returns
the Event associated with the command
214 215 216 217 218 219 220 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 214 def self.enqueue_unmap_mem_object( command_queue, mem_obj, mapped_ptr, = {} ) num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueUnmapMemObject( command_queue, mem_obj, mapped_ptr, num_events, events, event ) error_check( error ) return Event::new( event.read_pointer, false ) end |
.enqueue_wait_for_events(command_queue, events) ⇒ Object
Enqueues a barrier on a list of envents
Attributes
-
command_queue
- CommandQueue used to execute the command -
events
- a single or an Array of Event to wait upon before the barrier is considered finished
Returns
an Event if implementation version is >= 1.2, nil otherwise
990 991 992 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 990 def self.enqueue_wait_for_events( command_queue, events ) return ( command_queue, events ) end |
.enqueue_write_buffer(command_queue, buffer, ptr, options = {}) ⇒ Object
Enqueues a command to write to a Buffer object from host memory
Attributes
-
command_queue
- CommandQueue used to execute the write command -
buffer
- the Buffer to be written to -
ptr
- the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_write
- if provided indicates if the command blocks until the region is written. -
:blocking
- if provided indicates if the command blocks until the region is written -
:offset
- if provided indicates the offset inside the Buffer of the area to read from, else 0 -
:size
- if provided indicates the size of data to copy, else the maximum data is copied
Returns
the Event associated with the command
501 502 503 504 505 506 507 508 509 510 511 512 513 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 501 def self.enqueue_write_buffer( command_queue, buffer, ptr, = {} ) blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_write] offset = 0 offset = [:offset] if [:offset] size = buffer.size - offset size = [:size] if [:size] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueWriteBuffer(command_queue, buffer, blocking, offset, size, ptr, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_write_buffer_rect(command_queue, buffer, ptr, region, options = {}) ⇒ Object
Enqueues a command to write to a rectangular region in a Buffer object from host memory
Attributes
-
command_queue
- CommandQueue used to execute the write command -
buffer
- the Buffer to be written to -
ptr
- the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
region
- the region to write in the Buffer -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_write
- if provided indicates if the command blocks until the region is written -
:blocking
- if provided indicates if the command blocks until the region is written -
:buffer_origin
- if provided indicates the origin inside the buffer of the area to copy, else [0, 0, 0] -
:host_origin
- if provided indicates the origin inside the target host area, else [0, 0, 0] -
:buffer_row_pitch
- if provided indicates the row pitch inside the buffer, else 0 -
:buffer_slice_pitch
- if provided indicates the slice pitch inside the buffer, else 0 -
:host_row_pitch
- if provided indicates the row pitch inside the host area, else 0 -
:host_slice_pitch
- if provided indicates the slice pitch inside the host area, else 0
Returns
the Event associated with the command
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 324 def self.enqueue_write_buffer_rect(command_queue, buffer, ptr, region, = {}) error_check(INVALID_OPERATION) if command_queue.device.platform.version_number < 1.1 blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_write] buffer_origin = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| buffer_origin[i].write_size_t(0) } bo = [:dst_origin] ? [:dst_origin] : [:buffer_origin] if bo then bo.each_with_index { |e, i| buffer_origin[i].write_size_t(e) } end host_origin = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| host_origin[i].write_size_t(0) } ho = [:src_origin] ? [:src_origin] : [:host_origin] if ho then ho.each_with_index { |e, i| host_origin[i].write_size_t(e) } end r = MemoryPointer::new( :size_t, 3 ) (0..2).each { |i| r[i].write_size_t(0) } region[0..2].each_with_index { |e, i| r[i].write_size_t(e) } buffer_row_pitch = [:dst_row_pitch] ? [:dst_row_pitch] : [:buffer_row_pitch] if not buffer_row_pitch then buffer_row_pitch = 0 end buffer_slice_pitch = [:dst_slice_pitch] ? [:dst_slice_pitch] : [:buffer_slice_pitch] if not buffer_slice_pitch then buffer_slice_pitch = 0 end host_row_pitch = [:src_row_pitch] ? [:src_row_pitch] : [:host_row_pitch] if not host_row_pitch then host_row_pitch = 0 end host_slice_pitch = [:src_slice_pitch] ? [:src_slice_pitch] : [:host_slice_pitch] if not host_slice_pitch then host_slice_pitch = 0 end num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueWriteBufferRect(command_queue, buffer, blocking, buffer_origin, host_origin, r, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events, events, event) error_check(error) return Event::new(event.read_pointer, false) end |
.enqueue_write_image(command_queue, image, ptr, options = {}) ⇒ Object
Enqueues a command to copy from host memory into an Image
Attributes
-
command_queue
- CommandQueue used to execute the write command -
image
- the Image to be written to -
ptr
- the Pointer (or convertible to Pointer using to_ptr) to the memory area to use -
options
- a hash containing named options
Options
-
:event_wait_list
- if provided, a list of Event to wait upon before executing the command -
:blocking_write
- if provided indicates if the command blocks until the region is written. -
:blocking
- if provided indicates if the command blocks until the region is written -
:origin
- if provided indicates the origin of the region to write into the Image, else [0, 0, 0] -
:region
- if provided indicates the dimension of the region to copy, else the maximum region is copied -
:input_row_pitch
- if provided indicates the row pitch inside the host area, else 0 -
:input_slice_pitch
- if provided indicates the slice pitch inside the host area, else 0
Returns
the Event associated with the command
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 762 def self.enqueue_write_image(command_queue, image, ptr, = {}) blocking = FALSE blocking = TRUE if [:blocking] or [:blocking_write] origin, region = get_origin_region( image, , :origin, :region ) input_row_pitch = 0 input_row_pitch = [:input_row_pitch] if [:input_row_pitch] input_slice_pitch = 0 input_slice_pitch = [:input_slice_pitch] if [:input_slice_pitch] num_events, events = get_event_wait_list( ) event = MemoryPointer::new( Event ) error = clEnqueueWriteImage( command_queue, image, blocking, origin, region, input_row_pitch, input_slice_pitch, ptr, num_events, events, event ) error_check(error) return Event::new(event.read_pointer, false) end |
.finish(command_queue) ⇒ Object
Blocks until all the commands in the queue have completed
Attributes
-
command_queue
- the CommandQueue to finish
9 10 11 12 13 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 9 def self.finish( command_queue ) error = clFinish( command_queue ) error_check( error ) return command_queue end |
.flush(command_queue) ⇒ Object
Issues all the commands in a CommandQueue to the Device
Attributes
-
command_queue
- the CommandQueue to flush
20 21 22 23 24 |
# File 'lib/opencl_ruby_ffi/CommandQueue.rb', line 20 def self.flush( command_queue ) error = clFlush( command_queue ) error_check( error ) return command_queue end |
.get_device_and_host_timer(device) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/opencl_ruby_ffi/Device.rb', line 33 def self.get_device_and_host_timer( device ) error_check(INVALID_OPERATION) if device.platform.version_number < 2.1 = MemoryPointer::new( :cl_ulong ) = MemoryPointer::new( :cl_ulong ) error = clGetDeviceAndHostTimer( device, , ) error_check(error) return [ .read_cl_ulong, .read_cl_ulong ] end |
.get_extension_function(name, return_type, param_types, options = {}) ⇒ Object
Returns a Function corresponding to an extension function
Attributes
-
name
- a String representing the name of the function -
return_type
- the type of data returned by the function -
param_types
- an Array of types, corresponding to the parameters type -
options
- if given, a hash of named options that will be given to Function::new. See FFI doc for details.
31 32 33 34 35 36 |
# File 'lib/opencl_ruby_ffi/Platform.rb', line 31 def self.get_extension_function( name, return_type, param_types, = {} ) name_p = MemoryPointer.from_string(name) ptr = clGetExtensionFunctionAddress( name_p ) return nil if ptr.null? return Function::new(return_type, param_types, ptr, ) end |
.get_extension_function_for_platform(platform, name, return_type, param_types, options = {}) ⇒ Object
Returns a Function corresponding to an extension function for the Platform
Attributes
-
platform
- the Platform to be queried -
name
- a String representing the name of the function -
return_type
- the type of data returned by the function -
param_types
- an Array of types, corresponding to the parameters type -
options
- if given, a hash of named options that will be given to Function::new. See FFI doc for details.
56 57 58 59 60 61 62 |
# File 'lib/opencl_ruby_ffi/Platform.rb', line 56 def self.get_extension_function_for_platform( platform, name, return_type, param_types, = {} ) error_check(INVALID_OPERATION) if platform.version_number < 1.2 name_p = MemoryPointer.from_string(name) ptr = clGetExtensionFunctionAddressForPlatform( platform, name_p ) return nil if ptr.null? return Function::new(return_type, param_types, ptr, ) end |
.get_gl_context_info_khr(properties, param_name) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/opencl_ruby_ffi/khr/gl_sharing.rb', line 24 def self.get_gl_context_info_khr( properties, param_name ) props = MemoryPointer::new( :cl_context_properties, properties.length + 1 ) properties.each_with_index { |e,i| props[i].write_cl_context_properties(e) } props[properties.length].write_cl_context_properties(0) size_p = MemoryPointer::new( :size_t ) error = clGetGLContextInfoKHR( props, param_name, 0, nil, size_p ) error_check(error) size = size_p.read_size_t nb_devices = size/Device.size values = MemoryPointer::new( Device, nb_devices ) error = clGetGLContextInfoKHR( props, param_name, size, values, nil ) error_check(error) return values.get_array_of_pointer(0, nb_devices).collect { |device_ptr| Device::new(device_ptr, false) } end |
.get_host_timer(device) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/opencl_ruby_ffi/Device.rb', line 42 def self.get_host_timer( device ) error_check(INVALID_OPERATION) if device.platform.version_number < 2.1 = MemoryPointer::new( :cl_ulong ) error = clGetHostTimer( device, ) error_check(error) return .read_cl_ulong end |
.get_platforms ⇒ Object Also known as: platforms
Returns an Array of Platform containing the available OpenCL platforms
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/opencl_ruby_ffi/Platform.rb', line 65 def self.get_platforms @_platforms ||= begin ptr1 = MemoryPointer::new(:cl_uint , 1) error = clGetPlatformIDs(0, nil, ptr1) error_check(error) ptr2 = MemoryPointer::new(:pointer, ptr1.read_uint) error = clGetPlatformIDs(ptr1.read_uint(), ptr2, nil) error_check(error) ptr2.get_array_of_pointer(0,ptr1.read_uint()).collect { |platform_ptr| Platform::new(platform_ptr, false) } end end |
.link_program(context, input_programs, options = {}, &block) ⇒ Object
Links a set of compiled programs for all device in a Context, or a subset of devices
Attributes
-
context
- Context the created Program will be associated with -
input_programs
- a single or an Array of Program -
options
- a Hash containing named options -
block
- if provided, a callback invoked when the Program is built. Signature of the callback is { |Program, Pointer to user_data| … }
Options
-
:device_list
- an Array of Device to build the program for -
:options
- a String containing the options to use for the build -
:user_data
- a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 50 def self.link_program(context, input_programs, = {}, &block) if block wrapper_block = lambda { |p, u| block.call(p, u) @@callbacks.delete(wrapper_block) } @@callbacks[wrapper_block] = [:user_data] else wrapper_block = nil end num_devices, devices_p = get_device_list( ) opt = "" opt = [:options] if [:options] = MemoryPointer.from_string(opt) programs = [input_programs].flatten num_programs = programs.length programs_p = MemoryPointer::new( Program, num_programs ) programs_p.write_array_of_pointer(programs) error = MemoryPointer::new( :cl_int ) prog = clLinkProgram( context, num_devices, devices_p, , num_programs, programs_p, wrapper_block, [:user_data], error) error_check(error.read_cl_int) return Program::new( prog, false ) end |
.sBGRA ⇒ Object
290 291 292 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 290 def self.sBGRA return 0x10C2 end |
.set_context_destructor_callback(context, options = {}, &block) ⇒ Object
Attaches a callback to context that will be called on context destruction
Attributes
-
context
- the Program to attach the callback to -
options
- a hash containing named options -
block
- if provided, a callback invoked when program is released. Signature of the callback is { |Pointer to the context, Pointer to user_data| … }
Options
-
:user_data
- a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/opencl_ruby_ffi/Context.rb', line 91 def self.set_context_destructor_callback( context, = {}, &block ) if block wrapper_block = lambda { |p, u| block.call(p, u) @@callbacks.delete(wrapper_block) } @@callbacks[wrapper_block] = [:user_data] else wrapper_block = nil end error = clSetContextDestructorCallback( context, wrapper_block, [:user_data] ) error_check(error) return context end |
.set_default_device_command_queue(context, device, command_queue) ⇒ Object
73 74 75 76 77 78 |
# File 'lib/opencl_ruby_ffi/Context.rb', line 73 def self.set_default_device_command_queue( context, device, command_queue ) error_check(INVALID_OPERATION) if context.platform.version_number < 2.1 error = clSetDefaultDeviceCommandQueue( context, device, command_queue ) error_check(error) return context end |
.set_event_callback(event, command_exec_callback_type, options = {}, &proc) ⇒ Object
Attaches a callback to event that will be called on the given transition
Attributes
-
event
- the Event to attach the callback to -
command_exec_callback_type
- a CommandExecutionStatus -
options
- a hash containing named options -
block
- a callback invoked when the given event occurs. Signature of the callback is { |Event, :cl_int event_command_exec_status, Pointer to user_data| … }
Options
-
:user_data
- a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
28 29 30 31 32 33 |
# File 'lib/opencl_ruby_ffi/Event.rb', line 28 def self.set_event_callback( event, command_exec_callback_type, = {}, &proc ) error_check(INVALID_OPERATION) if event.context.platform.version_number < 1.1 error = clSetEventCallback( event, command_exec_callback_type, proc, [:user_data] ) error_check(error) return self end |
.set_kernel_arg(kernel, index, value, size = nil) ⇒ Object
Set the index th argument of Kernel to value. size of value can be specified
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 28 def self.set_kernel_arg( kernel, index, value, size = nil ) sz = size sz = value.class.size if sz == nil val = value if value.kind_of?(Mem) val = MemoryPointer::new( Mem ) val.write_pointer(value.to_ptr) elsif value.kind_of?(Sampler) val = MemoryPointer::new( Sampler ) val.write_pointer(value.to_ptr) end error = clSetKernelArg( kernel, index, sz, val ) error_check(error) end |
.set_kernel_arg_svm_pointer(kernel, index, value) ⇒ Object
Set the index th argument of Kernel to value. Value must be within a SVM memory area
73 74 75 76 77 78 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 73 def self.set_kernel_arg_svm_pointer( kernel, index, value ) error_check(INVALID_OPERATION) if kernel.context.platform.version_number < 2.0 error = clSetKernelArgSVMPointer( kernel, index, val ) error_check(error) return kernel end |
.set_mem_object_destructor_callback(memobj, options = {}, &block) ⇒ Object
Attaches a callback to memobj that will be called on memobj destruction
Attributes
-
memobj
- the Mem to attach the callback to -
options
- a hash containing named options -
block
- if provided, a callback invoked when memobj is released. Signature of the callback is { |Pointer to the deleted Mem, Pointer to user_data| … }
Options
-
:user_data
- a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/opencl_ruby_ffi/Mem.rb', line 15 def self.set_mem_object_destructor_callback( memobj, = {}, &block ) if block wrapper_block = lambda { |p, u| block.call(p, u) @@callbacks.delete(wrapper_block) } @@callbacks[wrapper_block] = [:user_data] else wrapper_block = nil end error = clSetMemObjectDestructorCallback( memobj, wrapper_block, [:user_data] ) error_check(error) return memobj end |
.set_program_release_callback(program, options = {}, &block) ⇒ Object
Attaches a callback to program that will be called on program release
Attributes
-
program
- the Program to attach the callback to -
options
- a hash containing named options -
block
- if provided, a callback invoked when program is released. Signature of the callback is { |Pointer to the program, Pointer to user_data| … }
Options
-
:user_data
- a Pointer (or convertible to Pointer using to_ptr) to the memory area to pass to the callback
241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 241 def self.set_program_release_callback( program, = {}, &block ) if block wrapper_block = lambda { |p, u| block.call(p, u) @@callbacks.delete(wrapper_block) } @@callbacks[wrapper_block] = [:user_data] else wrapper_block = nil end error = clSetProgramReleaseCallback( program, wrapper_block, [:user_data] ) error_check(error) return program end |
.set_program_specialization_constant(program, spec_id, spec_value, spec_size = nil) ⇒ Object
Sets a specialization constant in a program
Attributes
-
program
- the Program to which constant needs to be set -
spec_id
- the id of the specialization constant -
spec_value
- value the constant must be set to -
spec_size
- optional spec_value size
265 266 267 268 269 270 271 |
# File 'lib/opencl_ruby_ffi/Program.rb', line 265 def self.set_program_specialization_constant( program, spec_id, spec_value, spec_size = nil) sz = spec_size sz = spec_value.class.size if sz == nil error = clSetProgramSpecializationConstant( program, spec_id, sz, spec_value ) error_check(error) return program end |
.set_user_event_status(event, execution_status) ⇒ Object
Sets the satus of user Event to the given execution status
49 50 51 52 53 54 |
# File 'lib/opencl_ruby_ffi/Event.rb', line 49 def self.set_user_event_status( event, execution_status ) error_check(INVALID_OPERATION) if event.context.platform.version_number < 1.1 error = clSetUserEventStatus( event, execution_status ) error_check(error) return self end |
.sRGB ⇒ Object
281 282 283 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 281 def self.sRGB return 0x10BF end |
.sRGBA ⇒ Object
287 288 289 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 287 def self.sRGBA return 0x10C1 end |
.sRGBx ⇒ Object
284 285 286 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 284 def self.sRGBx return 0x10C0 end |
.svm_alloc(context, size, options = {}) ⇒ Object
Creates an SVMPointer pointing to an SVM area of memory
Attributes
-
context
- the Context in which to allocate the memory -
size
- the size of the mmemory area to allocate -
options
- a hash containing named options
Options
-
:alignment
- imposes the minimum alignment in byte
51 52 53 54 55 56 57 58 59 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 51 def self.svm_alloc(context, size, = {}) error_check(INVALID_OPERATION) if context.platform.version_number < 2.0 flags = get_flags() alignment = 0 alignment = [:alignment] if [:alignment] ptr = clSVMAlloc( context, flags, size, alignment ) error_check(MEM_OBJECT_ALLOCATION_FAILURE) if ptr.null? return SVMPointer::new( ptr.slice(0, size), context ) end |
.svm_free(context, svm_pointer) ⇒ Object
Frees an SVMPointer
Attributes
-
context
- the Context in which to deallocate the memory -
svm_pointer
- the SVMPointer to deallocate
67 68 69 70 |
# File 'lib/opencl_ruby_ffi/SVM.rb', line 67 def self.svm_free(context, svm_pointer) error_check(INVALID_OPERATION) if context.platform.version_number < 2.0 return clSVMFree( context, svm_pointer ) end |
.terminate_context_khr(context) ⇒ Object
10 11 12 13 14 |
# File 'lib/opencl_ruby_ffi/khr/terminate_context.rb', line 10 def self.terminate_context_khr( context ) error_check(INVALID_OPERATION) unless context.platform.extensions.include? "cl_khr_terminate_context" error = clTerminateContextKHR( context ) error_check(error) end |
.unload_compiler ⇒ Object
Unloads the compiler
17 18 19 20 21 |
# File 'lib/opencl_ruby_ffi/Platform.rb', line 17 def self.unload_compiler error = clUnloadCompiler() error_check(error) return nil end |
.unload_platform_compiler(platform) ⇒ Object
Unloads a Platform compiler
Attributes
-
platform
- the Platform to have it's compiler unloaded
9 10 11 12 13 14 |
# File 'lib/opencl_ruby_ffi/Platform.rb', line 9 def self.unload_platform_compiler(platform) error_check(INVALID_OPERATION) if self.version_number < 1.2 error = clUnloadPlatformCompiler( platform ) error_check(error) return platform end |
.wait_for_events(event_list) ⇒ Object
Waits for the command identified by Event objects to complete
Attributes
-
event_list
- a single or an Array of Event to wait upon before returning
9 10 11 12 13 14 |
# File 'lib/opencl_ruby_ffi/Event.rb', line 9 def self.wait_for_events(event_list) num_events, events = get_event_wait_list( {:event_wait_list => event_list } ) error = clWaitForEvents(num_events, events) error_check(error) return nil end |
Constant Summary collapse
- SUCCESS =
0
- DEVICE_NOT_FOUND =
-1
- DEVICE_NOT_AVAILABLE =
-2
- COMPILER_NOT_AVAILABLE =
-3
- MEM_OBJECT_ALLOCATION_FAILURE =
-4
- OUT_OF_RESOURCES =
-5
- OUT_OF_HOST_MEMORY =
-6
- PROFILING_INFO_NOT_AVAILABLE =
-7
- MEM_COPY_OVERLAP =
-8
- IMAGE_FORMAT_MISMATCH =
-9
- IMAGE_FORMAT_NOT_SUPPORTED =
-10
- BUILD_PROGRAM_FAILURE =
-11
- MAP_FAILURE =
-12
- MISALIGNED_SUB_BUFFER_OFFSET =
-13
- EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST =
-14
- COMPILE_PROGRAM_FAILURE =
-15
- LINKER_NOT_AVAILABLE =
-16
- LINK_PROGRAM_FAILURE =
-17
- DEVICE_PARTITION_FAILED =
-18
- KERNEL_ARG_INFO_NOT_AVAILABLE =
-19
- INVALID_VALUE =
-30
- INVALID_DEVICE_TYPE =
-31
- INVALID_PLATFORM =
-32
- INVALID_DEVICE =
-33
- INVALID_CONTEXT =
-34
- INVALID_QUEUE_PROPERTIES =
-35
- INVALID_COMMAND_QUEUE =
-36
- INVALID_HOST_PTR =
-37
- INVALID_MEM_OBJECT =
-38
- INVALID_IMAGE_FORMAT_DESCRIPTOR =
-39
- INVALID_IMAGE_SIZE =
-40
- INVALID_SAMPLER =
-41
- INVALID_BINARY =
-42
- INVALID_BUILD_OPTIONS =
-43
- INVALID_PROGRAM =
-44
- INVALID_PROGRAM_EXECUTABLE =
-45
- INVALID_KERNEL_NAME =
-46
- INVALID_KERNEL_DEFINITION =
-47
- INVALID_KERNEL =
-48
- INVALID_ARG_INDEX =
-49
- INVALID_ARG_VALUE =
-50
- INVALID_ARG_SIZE =
-51
- INVALID_KERNEL_ARGS =
-52
- INVALID_WORK_DIMENSION =
-53
- INVALID_WORK_GROUP_SIZE =
-54
- INVALID_WORK_ITEM_SIZE =
-55
- INVALID_GLOBAL_OFFSET =
-56
- INVALID_EVENT_WAIT_LIST =
-57
- INVALID_EVENT =
-58
- INVALID_OPERATION =
-59
- INVALID_GL_OBJECT =
-60
- INVALID_BUFFER_SIZE =
-61
- INVALID_MIP_LEVEL =
-62
- INVALID_GLOBAL_WORK_SIZE =
-63
- INVALID_PROPERTY =
-64
- INVALID_IMAGE_DESCRIPTOR =
-65
- INVALID_COMPILER_OPTIONS =
-66
- INVALID_LINKER_OPTIONS =
-67
- INVALID_DEVICE_PARTITION_COUNT =
-68
- INVALID_PIPE_SIZE =
-69
- INVALID_DEVICE_QUEUE =
-70
- INVALID_SPEC_ID =
-71
- MAX_SIZE_RESTRICTION_EXCEEDED =
-72
- INVALID_PARTITION_NAME_EXT =
-1059
- VERSION_1_0 =
1
- VERSION_1_1 =
1
- VERSION_1_2 =
1
- VERSION_2_0 =
1
- VERSION_2_1 =
1
- VERSION_2_2 =
1
- FALSE =
0
- TRUE =
1
- BLOCKING =
TRUE
- NON_BLOCKING =
FALSE
- PLATFORM_PROFILE =
0x0900
- PLATFORM_VERSION =
0x0901
- PLATFORM_NAME =
0x0902
- PLATFORM_VENDOR =
0x0903
- PLATFORM_EXTENSIONS =
0x0904
- PLATFORM_HOST_TIMER_RESOLUTION =
0x0905
- PLATFORM_NUMERIC_VERSION =
0x0906
- PLATFORM_EXTENSIONS_WITH_VERSION =
0x0907
- DEVICE_TYPE_DEFAULT =
(1 << 0)
- DEVICE_TYPE_CPU =
(1 << 1)
- DEVICE_TYPE_GPU =
(1 << 2)
- DEVICE_TYPE_ACCELERATOR =
(1 << 3)
- DEVICE_TYPE_CUSTOM =
(1 << 4)
- DEVICE_TYPE_ALL =
0xFFFFFFFF
- DEVICE_TYPE =
0x1000
- DEVICE_VENDOR_ID =
0x1001
- DEVICE_MAX_COMPUTE_UNITS =
0x1002
- DEVICE_MAX_WORK_ITEM_DIMENSIONS =
0x1003
- DEVICE_MAX_WORK_GROUP_SIZE =
0x1004
- DEVICE_MAX_WORK_ITEM_SIZES =
0x1005
- DEVICE_PREFERRED_VECTOR_WIDTH_CHAR =
0x1006
- DEVICE_PREFERRED_VECTOR_WIDTH_SHORT =
0x1007
- DEVICE_PREFERRED_VECTOR_WIDTH_INT =
0x1008
- DEVICE_PREFERRED_VECTOR_WIDTH_LONG =
0x1009
- DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT =
0x100A
- DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE =
0x100B
- DEVICE_MAX_CLOCK_FREQUENCY =
0x100C
- DEVICE_ADDRESS_BITS =
0x100D
- DEVICE_MAX_READ_IMAGE_ARGS =
0x100E
- DEVICE_MAX_WRITE_IMAGE_ARGS =
0x100F
- DEVICE_MAX_MEM_ALLOC_SIZE =
0x1010
- DEVICE_IMAGE2D_MAX_WIDTH =
0x1011
- DEVICE_IMAGE2D_MAX_HEIGHT =
0x1012
- DEVICE_IMAGE3D_MAX_WIDTH =
0x1013
- DEVICE_IMAGE3D_MAX_HEIGHT =
0x1014
- DEVICE_IMAGE3D_MAX_DEPTH =
0x1015
- DEVICE_IMAGE_SUPPORT =
0x1016
- DEVICE_MAX_PARAMETER_SIZE =
0x1017
- DEVICE_MAX_SAMPLERS =
0x1018
- DEVICE_MEM_BASE_ADDR_ALIGN =
0x1019
- DEVICE_MIN_DATA_TYPE_ALIGN_SIZE =
0x101A
- DEVICE_SINGLE_FP_CONFIG =
0x101B
- DEVICE_GLOBAL_MEM_CACHE_TYPE =
0x101C
- DEVICE_GLOBAL_MEM_CACHELINE_SIZE =
0x101D
- DEVICE_GLOBAL_MEM_CACHE_SIZE =
0x101E
- DEVICE_GLOBAL_MEM_SIZE =
0x101F
- DEVICE_MAX_CONSTANT_BUFFER_SIZE =
0x1020
- DEVICE_MAX_CONSTANT_ARGS =
0x1021
- DEVICE_LOCAL_MEM_TYPE =
0x1022
- DEVICE_LOCAL_MEM_SIZE =
0x1023
- DEVICE_ERROR_CORRECTION_SUPPORT =
0x1024
- DEVICE_PROFILING_TIMER_RESOLUTION =
0x1025
- DEVICE_ENDIAN_LITTLE =
0x1026
- DEVICE_AVAILABLE =
0x1027
- DEVICE_COMPILER_AVAILABLE =
0x1028
- DEVICE_EXECUTION_CAPABILITIES =
0x1029
- DEVICE_QUEUE_PROPERTIES =
0x102A
- DEVICE_QUEUE_ON_HOST_PROPERTIES =
0x102A
- DEVICE_NAME =
0x102B
- DEVICE_VENDOR =
0x102C
- DRIVER_VERSION =
0x102D
- DEVICE_PROFILE =
0x102E
- DEVICE_VERSION =
0x102F
- DEVICE_EXTENSIONS =
0x1030
- DEVICE_PLATFORM =
0x1031
- DEVICE_PREFERRED_VECTOR_WIDTH_HALF =
0x1034
- DEVICE_HOST_UNIFIED_MEMORY =
0x1035
- DEVICE_NATIVE_VECTOR_WIDTH_CHAR =
0x1036
- DEVICE_NATIVE_VECTOR_WIDTH_SHORT =
0x1037
- DEVICE_NATIVE_VECTOR_WIDTH_INT =
0x1038
- DEVICE_NATIVE_VECTOR_WIDTH_LONG =
0x1039
- DEVICE_NATIVE_VECTOR_WIDTH_FLOAT =
0x103A
- DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE =
0x103B
- DEVICE_NATIVE_VECTOR_WIDTH_HALF =
0x103C
- DEVICE_OPENCL_C_VERSION =
0x103D
- DEVICE_LINKER_AVAILABLE =
0x103E
- DEVICE_BUILT_IN_KERNELS =
0x103F
- DEVICE_IMAGE_MAX_BUFFER_SIZE =
0x1040
- DEVICE_IMAGE_MAX_ARRAY_SIZE =
0x1041
- DEVICE_PARENT_DEVICE =
0x1042
- DEVICE_PARTITION_MAX_SUB_DEVICES =
0x1043
- DEVICE_PARTITION_PROPERTIES =
0x1044
- DEVICE_PARTITION_AFFINITY_DOMAIN =
0x1045
- DEVICE_PARTITION_TYPE =
0x1046
- DEVICE_REFERENCE_COUNT =
0x1047
- DEVICE_PREFERRED_INTEROP_USER_SYNC =
0x1048
- DEVICE_PRINTF_BUFFER_SIZE =
0x1049
- DEVICE_IMAGE_PITCH_ALIGNMENT =
0x104A
- DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT =
0x104B
- DEVICE_MAX_READ_WRITE_IMAGE_ARGS =
0x104C
- DEVICE_MAX_GLOBAL_VARIABLE_SIZE =
0x104D
- DEVICE_QUEUE_ON_DEVICE_PROPERTIES =
0x104E
- DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE =
0x104F
- DEVICE_QUEUE_ON_DEVICE_MAX_SIZE =
0x1050
- DEVICE_MAX_ON_DEVICE_QUEUES =
0x1051
- DEVICE_MAX_ON_DEVICE_EVENTS =
0x1052
- DEVICE_SVM_CAPABILITIES =
0x1053
- DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE =
0x1054
- DEVICE_MAX_PIPE_ARGS =
0x1055
- DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS =
0x1056
- DEVICE_PIPE_MAX_PACKET_SIZE =
0x1057
- DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT =
0x1058
- DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT =
0x1059
- DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT =
0x105A
- DEVICE_IL_VERSION =
0x105B
- DEVICE_MAX_NUM_SUB_GROUPS =
0x105C
- DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS =
0x105D
- DEVICE_NUMERIC_VERSION =
0x105E
- DEVICE_EXTENSIONS_WITH_VERSION =
0x1060
- DEVICE_ILS_WITH_VERSION =
0x1061
- DEVICE_BUILT_IN_KERNELS_WITH_VERSION =
0x1062
- DEVICE_ATOMIC_MEMORY_CAPABILITIES =
0x1063
- DEVICE_ATOMIC_FENCE_CAPABILITIES =
0x1064
- DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT =
0x1065
- DEVICE_OPENCL_C_ALL_VERSIONS =
0x1066
- DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE =
0x1067
- DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT =
0x1068
- DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT =
0x1069
- DEVICE_OPENCL_C_FEATURES =
0x106F
- DEVICE_DEVICE_ENQUEUE_SUPPORT =
0x1070
- DEVICE_PIPE_SUPPORT =
0x1071
- FP_DENORM =
(1 << 0)
- FP_INF_NAN =
(1 << 1)
- FP_ROUND_TO_NEAREST =
(1 << 2)
- FP_ROUND_TO_ZERO =
(1 << 3)
- FP_ROUND_TO_INF =
(1 << 4)
- FP_FMA =
(1 << 5)
- FP_SOFT_FLOAT =
(1 << 6)
- FP_CORRECTLY_ROUNDED_DIVIDE_SQRT =
(1 << 7)
- NONE =
0x0
- READ_ONLY_CACHE =
0x1
- READ_WRITE_CACHE =
0x2
- LOCAL =
0x1
- GLOBAL =
0x2
- EXEC_KERNEL =
(1 << 0)
- EXEC_NATIVE_KERNEL =
(1 << 1)
- QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE =
(1 << 0)
- QUEUE_PROFILING_ENABLE =
(1 << 1)
- QUEUE_ON_DEVICE =
(1 << 2)
- QUEUE_ON_DEVICE_DEFAULT =
(1 << 3)
- CONTEXT_REFERENCE_COUNT =
0x1080
- CONTEXT_DEVICES =
0x1081
- CONTEXT_PROPERTIES =
0x1082
- CONTEXT_NUM_DEVICES =
0x1083
- CONTEXT_PLATFORM =
0x1084
- CONTEXT_INTEROP_USER_SYNC =
0x1085
- DEVICE_PARTITION_EQUALLY =
0x1086
- DEVICE_PARTITION_BY_COUNTS =
0x1087
- DEVICE_PARTITION_BY_COUNTS_LIST_END =
0x0
- DEVICE_PARTITION_BY_AFFINITY_DOMAIN =
0x1088
- DEVICE_AFFINITY_DOMAIN_NUMA =
(1 << 0)
- DEVICE_AFFINITY_DOMAIN_L4_CACHE =
(1 << 1)
- DEVICE_AFFINITY_DOMAIN_L3_CACHE =
(1 << 2)
- DEVICE_AFFINITY_DOMAIN_L2_CACHE =
(1 << 3)
- DEVICE_AFFINITY_DOMAIN_L1_CACHE =
(1 << 4)
- DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE =
(1 << 5)
- DEVICE_SVM_COARSE_GRAIN_BUFFER =
(1 << 0)
- DEVICE_SVM_FINE_GRAIN_BUFFER =
(1 << 1)
- DEVICE_SVM_FINE_GRAIN_SYSTEM =
(1 << 2)
- DEVICE_SVM_ATOMICS =
(1 << 3)
- DEVICE_ATOMIC_ORDER_RELAXED =
(1 << 0)
- DEVICE_ATOMIC_ORDER_ACQ_REL =
(1 << 1)
- DEVICE_ATOMIC_ORDER_SEQ_CST =
(1 << 2)
- DEVICE_ATOMIC_SCOPE_WORK_ITEM =
(1 << 3)
- DEVICE_ATOMIC_SCOPE_WORK_GROUP =
(1 << 4)
- DEVICE_ATOMIC_SCOPE_DEVICE =
(1 << 5)
- DEVICE_ATOMIC_SCOPE_ALL_DEVICES =
(1 << 6)
- QUEUE_CONTEXT =
0x1090
- QUEUE_DEVICE =
0x1091
- QUEUE_REFERENCE_COUNT =
0x1092
- QUEUE_PROPERTIES =
0x1093
- QUEUE_SIZE =
0x1094
- QUEUE_DEVICE_DEFAULT =
0x1095
- QUEUE_PROPERTIES_ARRAY =
0x1098
- MEM_READ_WRITE =
(1 << 0)
- MEM_WRITE_ONLY =
(1 << 1)
- MEM_READ_ONLY =
(1 << 2)
- MEM_USE_HOST_PTR =
(1 << 3)
- MEM_ALLOC_HOST_PTR =
(1 << 4)
- MEM_COPY_HOST_PTR =
(1 << 5)
- MEM_HOST_WRITE_ONLY =
(1 << 7)
- MEM_HOST_READ_ONLY =
(1 << 8)
- MEM_HOST_NO_ACCESS =
(1 << 9)
- MEM_SVM_FINE_GRAIN_BUFFER =
(1 << 10)
- MEM_SVM_ATOMICS =
(1 << 11)
- MEM_KERNEL_READ_AND_WRITE =
(1 << 12)
- MIGRATE_MEM_OBJECT_HOST =
(1 << 0)
- MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED =
(1 << 1)
- R =
0x10B0
- A =
0x10B1
- RG =
0x10B2
- RA =
0x10B3
- RGB =
0x10B4
- RGBA =
0x10B5
- BGRA =
0x10B6
- ARGB =
0x10B7
- INTENSITY =
0x10B8
- LUMINANCE =
0x10B9
- Rx =
0x10BA
- RGx =
0x10BB
- RGBx =
0x10BC
- DEPTH =
0x10BD
- DEPTH_STENCIL =
0x10BE
- ABGR =
0x10C3
- SNORM_INT8 =
0x10D0
- SNORM_INT16 =
0x10D1
- UNORM_INT8 =
0x10D2
- UNORM_INT16 =
0x10D3
- UNORM_SHORT_565 =
0x10D4
- UNORM_SHORT_555 =
0x10D5
- UNORM_INT_101010 =
0x10D6
- SIGNED_INT8 =
0x10D7
- SIGNED_INT16 =
0x10D8
- SIGNED_INT32 =
0x10D9
- UNSIGNED_INT8 =
0x10DA
- UNSIGNED_INT16 =
0x10DB
- UNSIGNED_INT32 =
0x10DC
- HALF_FLOAT =
0x10DD
- FLOAT =
0x10DE
- UNORM_INT24 =
0x10DF
- UNORM_INT_101010_2 =
0x10E0
- MEM_OBJECT_BUFFER =
0x10F0
- MEM_OBJECT_IMAGE2D =
0x10F1
- MEM_OBJECT_IMAGE3D =
0x10F2
- MEM_OBJECT_IMAGE2D_ARRAY =
0x10F3
- MEM_OBJECT_IMAGE1D =
0x10F4
- MEM_OBJECT_IMAGE1D_ARRAY =
0x10F5
- MEM_OBJECT_IMAGE1D_BUFFER =
0x10F6
- MEM_OBJECT_PIPE =
0x10F7
- MEM_TYPE =
0x1100
- MEM_FLAGS =
0x1101
- MEM_SIZE =
0x1102
- MEM_HOST_PTR =
0x1103
- MEM_MAP_COUNT =
0x1104
- MEM_REFERENCE_COUNT =
0x1105
- MEM_CONTEXT =
0x1106
- MEM_ASSOCIATED_MEMOBJECT =
0x1107
- MEM_OFFSET =
0x1108
- MEM_USES_SVM_POINTER =
0x1109
- MEM_PROPERTIES =
0x110A
- IMAGE_FORMAT =
0x1110
- IMAGE_ELEMENT_SIZE =
0x1111
- IMAGE_ROW_PITCH =
0x1112
- IMAGE_SLICE_PITCH =
0x1113
- IMAGE_WIDTH =
0x1114
- IMAGE_HEIGHT =
0x1115
- IMAGE_DEPTH =
0x1116
- IMAGE_ARRAY_SIZE =
0x1117
- IMAGE_BUFFER =
0x1118
- IMAGE_NUM_MIP_LEVELS =
0x1119
- IMAGE_NUM_SAMPLES =
0x111A
- PIPE_PACKET_SIZE =
0x1120
- PIPE_MAX_PACKETS =
0x1121
- PIPE_PROPERTIES =
0x1122
- ADDRESS_NONE =
0x1130
- ADDRESS_CLAMP_TO_EDGE =
0x1131
- ADDRESS_CLAMP =
0x1132
- ADDRESS_REPEAT =
0x1133
- ADDRESS_MIRRORED_REPEAT =
0x1134
- FILTER_NEAREST =
0x1140
- FILTER_LINEAR =
0x1141
- SAMPLER_REFERENCE_COUNT =
0x1150
- SAMPLER_CONTEXT =
0x1151
- SAMPLER_NORMALIZED_COORDS =
0x1152
- SAMPLER_ADDRESSING_MODE =
0x1153
- SAMPLER_FILTER_MODE =
0x1154
- SAMPLER_MIP_FILTER_MODE =
0x1155
- SAMPLER_LOD_MIN =
0x1156
- SAMPLER_LOD_MAX =
0x1157
- MAP_READ =
(1 << 0)
- MAP_WRITE =
(1 << 1)
- MAP_WRITE_INVALIDATE_REGION =
(1 << 2)
- PROGRAM_REFERENCE_COUNT =
0x1160
- PROGRAM_CONTEXT =
0x1161
- PROGRAM_NUM_DEVICES =
0x1162
- PROGRAM_DEVICES =
0x1163
- PROGRAM_SOURCE =
0x1164
- PROGRAM_BINARY_SIZES =
0x1165
- PROGRAM_BINARIES =
0x1166
- PROGRAM_NUM_KERNELS =
0x1167
- PROGRAM_KERNEL_NAMES =
0x1168
- PROGRAM_IL =
0x1169
- PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT =
0x116A
- PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT =
0x116B
- PROGRAM_BUILD_STATUS =
0x1181
- PROGRAM_BUILD_OPTIONS =
0x1182
- PROGRAM_BUILD_LOG =
0x1183
- PROGRAM_BINARY_TYPE =
0x1184
- PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE =
0x1185
- PROGRAM_BINARY_TYPE_NONE =
0x0
- PROGRAM_BINARY_TYPE_COMPILED_OBJECT =
0x1
- PROGRAM_BINARY_TYPE_LIBRARY =
0x2
- PROGRAM_BINARY_TYPE_EXECUTABLE =
0x4
- BUILD_SUCCESS =
0
- BUILD_NONE =
-1
- BUILD_ERROR =
-2
- BUILD_IN_PROGRESS =
-3
- KERNEL_FUNCTION_NAME =
0x1190
- KERNEL_NUM_ARGS =
0x1191
- KERNEL_REFERENCE_COUNT =
0x1192
- KERNEL_CONTEXT =
0x1193
- KERNEL_PROGRAM =
0x1194
- KERNEL_ATTRIBUTES =
0x1195
- KERNEL_ARG_ADDRESS_QUALIFIER =
0x1196
- KERNEL_ARG_ACCESS_QUALIFIER =
0x1197
- KERNEL_ARG_TYPE_NAME =
0x1198
- KERNEL_ARG_TYPE_QUALIFIER =
0x1199
- KERNEL_ARG_NAME =
0x119A
- KERNEL_ARG_ADDRESS_GLOBAL =
0x119B
- KERNEL_ARG_ADDRESS_LOCAL =
0x119C
- KERNEL_ARG_ADDRESS_CONSTANT =
0x119D
- KERNEL_ARG_ADDRESS_PRIVATE =
0x119E
- KERNEL_ARG_ACCESS_READ_ONLY =
0x11A0
- KERNEL_ARG_ACCESS_WRITE_ONLY =
0x11A1
- KERNEL_ARG_ACCESS_READ_WRITE =
0x11A2
- KERNEL_ARG_ACCESS_NONE =
0x11A3
- KERNEL_ARG_TYPE_NONE =
0
- KERNEL_ARG_TYPE_CONST =
(1 << 0)
- KERNEL_ARG_TYPE_RESTRICT =
(1 << 1)
- KERNEL_ARG_TYPE_VOLATILE =
(1 << 2)
- KERNEL_ARG_TYPE_PIPE =
(1 << 3)
- KERNEL_WORK_GROUP_SIZE =
0x11B0
- KERNEL_COMPILE_WORK_GROUP_SIZE =
0x11B1
- KERNEL_LOCAL_MEM_SIZE =
0x11B2
- KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE =
0x11B3
- KERNEL_PRIVATE_MEM_SIZE =
0x11B4
- KERNEL_GLOBAL_WORK_SIZE =
0x11B5
- KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE =
0x2033
- KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE =
0x2034
- KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT =
0x11B8
- KERNEL_MAX_NUM_SUB_GROUPS =
0x11B9
- KERNEL_COMPILE_NUM_SUB_GROUPS =
0x11BA
- KERNEL_EXEC_INFO_SVM_PTRS =
0x11B6
- KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM =
0x11B7
- EVENT_COMMAND_QUEUE =
0x11D0
- EVENT_COMMAND_TYPE =
0x11D1
- EVENT_REFERENCE_COUNT =
0x11D2
- EVENT_COMMAND_EXECUTION_STATUS =
0x11D3
- EVENT_CONTEXT =
0x11D4
- COMMAND_NDRANGE_KERNEL =
0x11F0
- COMMAND_TASK =
0x11F1
- COMMAND_NATIVE_KERNEL =
0x11F2
- COMMAND_READ_BUFFER =
0x11F3
- COMMAND_WRITE_BUFFER =
0x11F4
- COMMAND_COPY_BUFFER =
0x11F5
- COMMAND_READ_IMAGE =
0x11F6
- COMMAND_WRITE_IMAGE =
0x11F7
- COMMAND_COPY_IMAGE =
0x11F8
- COMMAND_COPY_IMAGE_TO_BUFFER =
0x11F9
- COMMAND_COPY_BUFFER_TO_IMAGE =
0x11FA
- COMMAND_MAP_BUFFER =
0x11FB
- COMMAND_MAP_IMAGE =
0x11FC
- COMMAND_UNMAP_MEM_OBJECT =
0x11FD
- COMMAND_MARKER =
0x11FE
- COMMAND_ACQUIRE_GL_OBJECTS =
0x11FF
- COMMAND_RELEASE_GL_OBJECTS =
0x1200
- COMMAND_READ_BUFFER_RECT =
0x1201
- COMMAND_WRITE_BUFFER_RECT =
0x1202
- COMMAND_COPY_BUFFER_RECT =
0x1203
- COMMAND_USER =
0x1204
- COMMAND_BARRIER =
0x1205
- COMMAND_MIGRATE_MEM_OBJECTS =
0x1206
- COMMAND_FILL_BUFFER =
0x1207
- COMMAND_FILL_IMAGE =
0x1208
- COMMAND_SVM_FREE =
0x1209
- COMMAND_SVM_MEMCPY =
0x120A
- COMMAND_SVM_MEMFILL =
0x120B
- COMMAND_SVM_MAP =
0x120C
- COMMAND_SVM_UNMAP =
0x120D
- COMMAND_SVM_MIGRATE_MEM =
0x120E
- COMPLETE =
0x0
- RUNNING =
0x1
- SUBMITTED =
0x2
- QUEUED =
0x3
- BUFFER_CREATE_TYPE_REGION =
0x1220
- PROFILING_COMMAND_QUEUED =
0x1280
- PROFILING_COMMAND_SUBMIT =
0x1281
- PROFILING_COMMAND_START =
0x1282
- PROFILING_COMMAND_END =
0x1283
- PROFILING_COMMAND_COMPLETE =
0x1284
- GL_OBJECT_BUFFER =
0x2000
- GL_OBJECT_TEXTURE2D =
0x2001
- GL_OBJECT_TEXTURE3D =
0x2002
- GL_OBJECT_RENDERBUFFER =
0x2003
- GL_OBJECT_TEXTURE2D_ARRAY =
0x200E
- GL_OBJECT_TEXTURE1D =
0x200F
- GL_OBJECT_TEXTURE1D_ARRAY =
0x2010
- GL_OBJECT_TEXTURE_BUFFER =
0x2011
- GL_TEXTURE_TARGET =
0x2004
- GL_MIPMAP_LEVEL =
0x2005
- GL_NUM_SAMPLES =
0x2012
- PRINTF_CALLBACK_ARM =
0x40B0
- PRINTF_BUFFERSIZE_ARM =
0x40B1
- DEVICE_PAGE_SIZE_QCOM =
0x40A1
- IMAGE_ROW_ALIGNMENT_QCOM =
0x40A2
- IMAGE_SLICE_ALIGNMENT_QCOM =
0x40A3
- MEM_HOST_UNCACHED_QCOM =
0x40A4
- MEM_HOST_WRITEBACK_QCOM =
0x40A5
- MEM_HOST_WRITETHROUGH_QCOM =
0x40A6
- MEM_HOST_WRITE_COMBINING_QCOM =
0x40A7
- MEM_ION_HOST_PTR_QCOM =
0x40A8
- NAME_VERSION_MAX_NAME_SIZE =
64
- VERSION_MAJOR_BITS =
10
- VERSION_MINOR_BITS =
10
- VERSION_PATCH_BITS =
12
- VERSION_MAJOR_MASK =
(1 << VERSION_MAJOR_BITS) - 1
- VERSION_MINOR_MASK =
(1 << VERSION_MINOR_BITS) - 1
- VERSION_PATCH_MASK =
(1 << VERSION_PATCH_BITS) - 1
- PLATFORM_NOT_FOUND_KHR =
-1001
- PLATFORM_ICD_SUFFIX_KHR =
0x0920
- DEVICE_HALF_FP_CONFIG =
0x1033
- DEVICE_DOUBLE_FP_CONFIG =
0x1032
- DEVICE_SPIR_VERSIONS =
0x40E0
- PROGRAM_BINARY_TYPE_INTERMEDIATE =
0x40E1
- COMMAND_GL_FENCE_SYNC_OBJECT_KHR =
0x200D
- COMMAND_EGL_FENCE_SYNC_OBJECT_KHR =
0x202F
- INVALID_EGL_OBJECT_KHR =
-1093
- EGL_RESOURCE_NOT_ACQUIRED_KHR =
-1092
- COMMAND_ACQUIRE_EGL_OBJECTS_KHR =
0x202D
- COMMAND_RELEASE_EGL_OBJECTS_KHR =
0x202E
- INVALID_GL_SHAREGROUP_REFERENCE_KHR =
-1000
- CURRENT_DEVICE_FOR_GL_CONTEXT_KHR =
0x2006
- DEVICES_FOR_GL_CONTEXT_KHR =
0x2007
- GL_CONTEXT_KHR =
0x2008
- EGL_DISPLAY_KHR =
0x2009
- GLX_DISPLAY_KHR =
0x200A
- WGL_HDC_KHR =
0x200B
- CGL_SHAREGROUP_KHR =
0x200C
- KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR =
0x2033
- KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR =
0x2034
- UUID_SIZE_KHR =
16
- LUID_SIZE_KHR =
8
- DEVICE_UUID_KHR =
0x106A
- DRIVER_UUID_KHR =
0x106B
- DEVICE_LUID_VALID_KHR =
0x106C
- DEVICE_LUID_KHR =
0x106D
- DEVICE_NODE_MASK_KHR =
0x106E
- CONTEXT_KERNEL_PROFILING_MODES_COUNT_INTEL =
Unofficial kernel profiling extension
0x407A
- CONTEXT_KERNEL_PROFILING_MODE_INFO_INTEL =
0x407B
- KERNEL_IL_SYMBOLS_INTEL =
0x407C
- KERNEL_BINARY_PROGRAM_INTEL =
0x407D
- PROGRAM_DEBUG_INFO_INTEL =
Unofficial VTune Debug Info extension
0x4100
- PROGRAM_DEBUG_INFO_SIZES_INTEL =
0x4101
- KERNEL_BINARIES_INTEL =
0x4102
- KERNEL_BINARY_SIZES_INTEL =
0x4103
- ACCELERATOR_DESCRIPTOR_INTEL =
0x4090
- ACCELERATOR_REFERENCE_COUNT_INTEL =
0x4091
- ACCELERATOR_CONTEXT_INTEL =
0x4092
- ACCELERATOR_TYPE_INTEL =
0x4093
- INVALID_ACCELERATOR_INTEL =
-1094
- INVALID_ACCELERATOR_TYPE_INTEL =
-1095
- INVALID_ACCELERATOR_DESCRIPTOR_INTEL =
-1096
- ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL =
-1097
- INVALID_D3D10_DEVICE_KHR =
-1002
- INVALID_D3D10_RESOURCE_KHR =
-1003
- D3D10_RESOURCE_ALREADY_ACQUIRED_KHR =
-1004
- D3D10_RESOURCE_NOT_ACQUIRED_KHR =
-1005
- D3D10_DEVICE_KHR =
0x4010
- D3D10_DXGI_ADAPTER_KHR =
0x4011
- PREFERRED_DEVICES_FOR_D3D10_KHR =
0x4012
- ALL_DEVICES_FOR_D3D10_KHR =
0x4013
- CONTEXT_D3D10_DEVICE_KHR =
0x4014
- CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR =
0x402C
- MEM_D3D10_RESOURCE_KHR =
0x4015
- IMAGE_D3D10_SUBRESOURCE_KHR =
0x4016
- COMMAND_ACQUIRE_D3D10_OBJECTS_KHR =
0x4017
- COMMAND_RELEASE_D3D10_OBJECTS_KHR =
0x4018
- INVALID_D3D11_DEVICE_KHR =
-1006
- INVALID_D3D11_RESOURCE_KHR =
-1007
- D3D11_RESOURCE_ALREADY_ACQUIRED_KHR =
-1008
- D3D11_RESOURCE_NOT_ACQUIRED_KHR =
-1009
- D3D11_DEVICE_KHR =
0x4019
- D3D11_DXGI_ADAPTER_KHR =
0x401A
- PREFERRED_DEVICES_FOR_D3D11_KHR =
0x401B
- ALL_DEVICES_FOR_D3D11_KHR =
0x401C
- CONTEXT_D3D11_DEVICE_KHR =
0x401D
- CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR =
0x402D
- MEM_D3D11_RESOURCE_KHR =
0x401E
- IMAGE_D3D11_SUBRESOURCE_KHR =
0x401F
- COMMAND_ACQUIRE_D3D11_OBJECTS_KHR =
0x4020
- COMMAND_RELEASE_D3D11_OBJECTS_KHR =
0x4021
- DEVICE_PARTITION_FAILED_EXT =
-1057
- INVALID_PARTITION_COUNT_EXT =
-1058
- DEVICE_PARTITION_EQUALLY_EXT =
0x4050
- DEVICE_PARTITION_BY_COUNTS_EXT =
0x4051
- DEVICE_PARTITION_BY_NAMES_EXT =
0x4052
- DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT =
0x4053
- DEVICE_PARENT_DEVICE_EXT =
0x4054
- DEVICE_PARTITION_TYPES_EXT =
0x4055
- DEVICE_AFFINITY_DOMAINS_EXT =
0x4056
- DEVICE_REFERENCE_COUNT_EXT =
0x4057
- DEVICE_PARTITION_STYLE_EXT =
0x4058
- AFFINITY_DOMAIN_L1_CACHE_EXT =
0x1
- AFFINITY_DOMAIN_L2_CACHE_EXT =
0x2
- AFFINITY_DOMAIN_L3_CACHE_EXT =
0x3
- AFFINITY_DOMAIN_L4_CACHE_EXT =
0x4
- AFFINITY_DOMAIN_NUMA_EXT =
0x10
- AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT =
0x100
- PROPERTIES_LIST_END_EXT =
0
- PARTITION_BY_COUNTS_LIST_END_EXT =
0
- PARTITION_BY_NAMES_LIST_END_EXT =
-1
- QUEUE_PRIORITY_KHR =
0x1096
- QUEUE_PRIORITY_HIGH_KHR =
(1<<0)
- QUEUE_PRIORITY_MED_KHR =
(1<<1)
- QUEUE_PRIORITY_LOW_KHR =
(1<<2)
- QUEUE_THROTTLE_KHR =
0x1097
- QUEUE_THROTTLE_HIGH_KHR =
(1<<0)
- QUEUE_THROTTLE_MED_KHR =
(1<<1)
- QUEUE_THROTTLE_LOW_KHR =
(1<<2)
- CONTEXT_MEMORY_INITIALIZE_KHR =
0x200E
- INVALID_DX9_MEDIA_ADAPTER_KHR =
-1010
- INVALID_DX9_MEDIA_SURFACE_KHR =
-1011
- DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR =
-1012
- DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR =
-1013
- ADAPTER_D3D9_KHR =
0x2020
- ADAPTER_D3D9EX_KHR =
0x2021
- ADAPTER_DXVA_KHR =
0x2022
- PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR =
0x2023
- ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR =
0x2024
- CONTEXT_ADAPTER_D3D9_KHR =
0x2025
- CONTEXT_ADAPTER_D3D9EX_KHR =
0x2026
- CONTEXT_ADAPTER_DXVA_KHR =
0x2027
- MEM_DX9_MEDIA_ADAPTER_TYPE_KHR =
0x2028
- MEM_DX9_MEDIA_SURFACE_INFO_KHR =
0x2029
- IMAGE_DX9_MEDIA_PLANE_KHR =
0x202A
- COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR =
0x202B
- COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR =
0x202C
- DEVICE_TERMINATE_CAPABILITY_KHR =
0x2031
- CONTEXT_TERMINATE_KHR =
0x2032
- Char =
OpenCL.find_type(:cl_char)
- UChar =
OpenCL.find_type(:cl_uchar)
- Short =
OpenCL.find_type(:cl_short)
- UShort =
OpenCL.find_type(:cl_ushort)
- Int =
OpenCL.find_type(:cl_int)
- UInt =
OpenCL.find_type(:cl_uint)
- Long =
OpenCL.find_type(:cl_long)
- ULong =
OpenCL.find_type(:cl_ulong)
- Float =
OpenCL.find_type(:cl_float)
- Double =
OpenCL.find_type(:cl_double)
- Half =
OpenCL.find_type(:cl_half)
- ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL =
0x0
- ME_MB_TYPE_16x16_INTEL =
0x0
- ME_MB_TYPE_8x8_INTEL =
0x1
- ME_MB_TYPE_4x4_INTEL =
0x2
- ME_SUBPIXEL_MODE_INTEGER_INTEL =
0x0
- ME_SUBPIXEL_MODE_HPEL_INTEL =
0x1
- ME_SUBPIXEL_MODE_QPEL_INTEL =
0x2
- ME_SAD_ADJUST_MODE_NONE_INTEL =
0x0
- ME_SAD_ADJUST_MODE_HAAR_INTEL =
0x1
- ME_SEARCH_PATH_RADIUS_2_2_INTEL =
0x0
- ME_SEARCH_PATH_RADIUS_4_4_INTEL =
0x1
- ME_SEARCH_PATH_RADIUS_16_12_INTEL =
0x5
- CONTEXT_DRIVER_DIAGNOSTICS_INTEL =
0x4106
- CONTEXT_SHOW_DIAGNOSTICS_INTEL =
0x4106
- CONTEXT_DIAGNOSTICS_LEVEL_GOOD_INTEL =
0x1
- CONTEXT_DIAGNOSTICS_LEVEL_BAD_INTEL =
0x2
- CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL =
0x4
- DEVICE_COMPUTE_CAPABILITY_MAJOR_NV =
0x4000
- DEVICE_COMPUTE_CAPABILITY_MINOR_NV =
0x4001
- DEVICE_REGISTERS_PER_BLOCK_NV =
0x4002
- DEVICE_WARP_SIZE_NV =
0x4003
- DEVICE_GPU_OVERLAP_NV =
0x4004
- DEVICE_KERNEL_EXEC_TIMEOUT_NV =
0x4005
- DEVICE_INTEGRATED_MEMORY_NV =
0x4006
- DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT_NV =
0x4007
- DEVICE_PCI_BUS_ID_NV =
0x4008
- DEVICE_PCI_SLOT_ID_NV =
0x4009
- DEVICE_TOPOLOGY_TYPE_PCIE_AMD =
1
- DEVICE_PROFILING_TIMER_OFFSET_AMD =
0x4036
- DEVICE_TOPOLOGY_AMD =
0x4037
- DEVICE_BOARD_NAME_AMD =
0x4038
- DEVICE_GLOBAL_FREE_MEMORY_AMD =
0x4039
- DEVICE_SIMD_PER_COMPUTE_UNIT_AMD =
0x4040
- DEVICE_SIMD_WIDTH_AMD =
0x4041
- DEVICE_SIMD_INSTRUCTION_WIDTH_AMD =
0x4042
- DEVICE_WAVEFRONT_WIDTH_AMD =
0x4043
- DEVICE_GLOBAL_MEM_CHANNELS_AMD =
0x4044
- DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD =
0x4045
- DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD =
0x4046
- DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD =
0x4047
- DEVICE_LOCAL_MEM_BANKS_AMD =
0x4048
- DEVICE_THREAD_TRACE_SUPPORTED_AMD =
0x4049
- DEVICE_GFXIP_MAJOR_AMD =
0x404A
- DEVICE_GFXIP_MINOR_AMD =
0x404B
- DEVICE_AVAILABLE_ASYNC_QUEUES_AMD =
0x404C
- DEVICE_ME_VERSION_INTEL =
0x407E
- ME_CHROMA_INTRA_PREDICT_ENABLED_INTEL =
0x1
- ME_LUMA_INTRA_PREDICT_ENABLED_INTEL =
0x2
- ME_SKIP_BLOCK_TYPE_16x16_INTEL =
0x0
- ME_SKIP_BLOCK_TYPE_8x8_INTEL =
0x4
- ME_COST_PENALTY_NONE_INTEL =
0x0
- ME_COST_PENALTY_LOW_INTEL =
0x1
- ME_COST_PENALTY_NORMAL_INTEL =
0x2
- ME_COST_PENALTY_HIGH_INTEL =
0x3
- ME_COST_PRECISION_QPEL_INTEL =
0x0
- ME_COST_PRECISION_HEL_INTEL =
0x1
- ME_COST_PRECISION_PEL_INTEL =
0x2
- ME_COST_PRECISION_DPEL_INTEL =
0x3
- ME_LUMA_PREDICTOR_MODE_VERTICAL_INTEL =
0x0
- ME_LUMA_PREDICTOR_MODE_HORIZONTAL_INTEL =
0x1
- ME_LUMA_PREDICTOR_MODE_DC_INTEL =
0x2
- ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_LEFT_INTEL =
0x3
- ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_RIGHT_INTEL =
0x4
- ME_LUMA_PREDICTOR_MODE_PLANE_INTEL =
0x4
- ME_LUMA_PREDICTOR_MODE_VERTICAL_RIGHT_INTEL =
0x5
- ME_LUMA_PREDICTOR_MODE_HORIZONTAL_DOWN_INTEL =
0x6
- ME_LUMA_PREDICTOR_MODE_VERTICAL_LEFT_INTEL =
0x7
- ME_LUMA_PREDICTOR_MODE_HORIZONTAL_UP_INTEL =
0x8
- ME_CHROMA_PREDICTOR_MODE_DC_INTEL =
0x0
- ME_CHROMA_PREDICTOR_MODE_HORIZONTAL_INTEL =
0x1
- ME_CHROMA_PREDICTOR_MODE_VERTICAL_INTEL =
0x2
- ME_CHROMA_PREDICTOR_MODE_PLANE_INTEL =
0x3
- ME_VERSION_LEGACY_INTEL =
0x0
- ME_VERSION_ADVANCED_VER_1_INTEL =
0x1
- ME_VERSION_ADVANCED_VER_2_INTEL =
0x2
- ME_FORWARD_INPUT_MODE_INTEL =
0x1
- ME_BACKWARD_INPUT_MODE_INTEL =
0x2
- ME_BIDIRECTION_INPUT_MODE_INTEL =
0x3
- ME_BIDIR_WEIGHT_QUARTER_INTEL =
0x10
- ME_BIDIR_WEIGHT_THIRD_INTEL =
0x15
- ME_BIDIR_WEIGHT_HALF_INTEL =
0x20
- ME_BIDIR_WEIGHT_TWO_THIRD_INTEL =
0x2B
- ME_BIDIR_WEIGHT_THREE_QUARTER_INTEL =
0x30
- DEVICE_HOST_MEM_CAPABILITIES_INTEL =
0x4190
- DEVICE_DEVICE_MEM_CAPABILITIES_INTEL =
0x4191
- DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL =
0x4192
- DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL =
0x4193
- DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL =
0x4194
- UNIFIED_SHARED_MEMORY_ACCESS_INTEL =
(1 << 0)
- UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL =
(1 << 1)
- UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL =
(1 << 2)
- UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTEL =
(1 << 3)
- MEM_ALLOC_FLAGS_INTEL =
0x4195
- MEM_ALLOC_WRITE_COMBINED_INTEL =
(1 << 0)
- MEM_TYPE_UNKNOWN_INTEL =
0x4196
- MEM_TYPE_HOST_INTEL =
0x4197
- MEM_TYPE_DEVICE_INTEL =
0x4198
- MEM_TYPE_SHARED_INTEL =
0x4199
- MEM_ALLOC_TYPE_INTEL =
0x419A
- MEM_ALLOC_BASE_PTR_INTEL =
0x419B
- MEM_ALLOC_SIZE_INTEL =
0x419C
- MEM_ALLOC_DEVICE_INTEL =
0x419D
- MEM_ALLOC_INFO_TBD1_INTEL =
0x419E
- MEM_ALLOC_INFO_TBD2_INTEL =
0x419F
- KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL =
0x4200
- KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL =
0x4201
- KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTEL =
0x4202
- KERNEL_EXEC_INFO_USM_PTRS_INTEL =
0x4203
- MIGRATE_MEM_OBJECT_HOST_INTEL =
(1 << 0)
- MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED_INTEL =
(1 << 1)
- COMMAND_MEMFILL_INTEL =
0x4204
- COMMAND_MEMCPY_INTEL =
0x4205
- COMMAND_MIGRATEMEM_INTEL =
0x4206
- COMMAND_MEMADVISE_INTEL =
0x4207
- MEM_ADVICE_TBD0_INTEL =
0x4208
- MEM_ADVICE_TBD1_INTEL =
0x4209
- MEM_ADVICE_TBD2_INTEL =
0x420A
- MEM_ADVICE_TBD3_INTEL =
0x420B
- MEM_ADVICE_TBD4_INTEL =
0x420C
- MEM_ADVICE_TBD5_INTEL =
0x420D
- MEM_ADVICE_TBD6_INTEL =
0x420E
- MEM_ADVICE_TBD7_INTEL =
0x420F
- @@callbacks =
{}