Class: OpenCL::Kernel::Arg
- Inherits:
-
Object
- Object
- OpenCL::Kernel::Arg
- Defined in:
- lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb,
lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb,
lib/opencl_ruby_ffi/Kernel.rb,
lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb
Overview
Maps the logical cl arg object
Defined Under Namespace
Modules: OpenCL12, UnifiedSharedMemoryPreviewINTEL Classes: AccessQualifier, AddressQualifier, TypeQualifier
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the index of the Arg in the list.
-
#kernel ⇒ Object
readonly
Returns the Kernel this Arg belongs to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kernel, index) ⇒ Arg
constructor
Creates a new arg for a Kernel at index.
-
#platform ⇒ Object
Returns the Platform associated with this Arg.
-
#set(value, size = nil) ⇒ Object
Sets this Arg to value.
Constructor Details
#initialize(kernel, index) ⇒ Arg
Creates a new arg for a Kernel at index
82 83 84 85 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 82 def initialize( kernel, index ) @index = index @kernel = kernel end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the index of the Arg in the list
66 67 68 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 66 def index @index end |
#kernel ⇒ Object (readonly)
Returns the Kernel this Arg belongs to
68 69 70 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 68 def kernel @kernel end |
Class Method Details
.register_extension(name, mod, cond) ⇒ Object
77 78 79 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 77 def self.register_extension(name, mod, cond) include mod end |
Instance Method Details
#platform ⇒ Object
Returns the Platform associated with this Arg
71 72 73 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 71 def platform kernel.platform end |
#set(value, size = nil) ⇒ Object
Sets this Arg to value. The size of value can be specified.
107 108 109 110 111 112 113 |
# File 'lib/opencl_ruby_ffi/Kernel.rb', line 107 def set(value, size = nil) if value.class == SVMPointer and @kernel.context.platform.version_number >= 2.0 then OpenCL.set_kernel_arg_svm_pointer( @kernel, @index, value ) else OpenCL.set_kernel_arg(@kernel, @index, value, size) end end |
Constant Summary collapse
- ADDRESS_QUALIFIER =
0x1196
- ACCESS_QUALIFIER =
0x1197
- TYPE_NAME =
0x1198
- TYPE_QUALIFIER =
0x1199
- NAME =
0x119A
- ADDRESS_GLOBAL =
0x119B
- ADDRESS_LOCAL =
0x119C
- ADDRESS_CONSTANT =
0x119D
- ADDRESS_PRIVATE =
0x119E
- ACCESS_READ_ONLY =
0x11A0
- ACCESS_WRITE_ONLY =
0x11A1
- ACCESS_READ_WRITE =
0x11A2
- ACCESS_NONE =
0x11A3
- TYPE_NONE =
0
- TYPE_CONST =
(1 << 0)
- TYPE_RESTRICT =
(1 << 1)
- TYPE_VOLATILE =
(1 << 2)
- TYPE_PIPE =
(1 << 3)
- Extensions =
{}