Module: OpenCL::Context::OpenCL12

Included in:
OpenCL::Context
Defined in:
lib/opencl_ruby_ffi/Context.rb

Instance Method Summary collapse

Instance Method Details

#create_from_gl_texture(texture_target, texture, options = {}) ⇒ Object Also known as: create_from_GL_texture

Creates an Image in the Context from an OpenGL 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



403
404
405
# File 'lib/opencl_ruby_ffi/Context.rb', line 403

def create_from_gl_texture( texture_target, texture, options = {} )
  return OpenCL.create_from_gl_texture( self, texture_target, texture, options )
end

#create_image(format, desc, options = {}) ⇒ Object

Creates an Image in the Context

Attributes

  • format - an ImageFormat

  • options - an ImageDesc

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



419
420
421
# File 'lib/opencl_ruby_ffi/Context.rb', line 419

def create_image( format, desc, options = {} )
  return OpenCL.create_image( self, format, desc, options )
end

#create_program_with_built_in_kernels(device_list, kernel_names) ⇒ Object

Creates a Program from a list of built in kernel names

Attributes

  • device_list - an Array of Device to create the program for

  • kernel_names - a single or an Array of String representing the kernel names



446
447
448
# File 'lib/opencl_ruby_ffi/Context.rb', line 446

def create_program_with_built_in_kernels( device_list, kernel_names )
  return OpenCL.create_program_with_built_in_kernels(self, device_list, kernel_names )
end

Links a set of compiled programs for all device in the Context, or a subset of devices

Attributes

  • 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



436
437
438
# File 'lib/opencl_ruby_ffi/Context.rb', line 436

def link_program( input_programs, options = {}, &block)
  return OpenCL.link_program(self, input_programs, options, &block)
end