Class: OpenCL::Char2

Inherits:
FFI::Struct show all
Defined in:
lib/opencl_ruby_ffi/Arithmetic_gen.rb

Overview

Maps the cl_char2 type of OpenCL

Instance Method Summary collapse

Constructor Details

#initialize(s0 = 0, s1 = 0) ⇒ Char2

Creates a new Char2 with members set to 0 or to the user specified values



238
239
240
241
242
# File 'lib/opencl_ruby_ffi/Arithmetic_gen.rb', line 238

def initialize( s0 = 0, s1 = 0 )
  super()
  self[:s0] = s0
  self[:s1] = s1
end

Instance Method Details

#s0Object

Reads the s0 member



244
245
246
# File 'lib/opencl_ruby_ffi/Arithmetic_gen.rb', line 244

def s0
 return self[:s0]
end

#s0=(value) ⇒ Object

Sets the s0 member to value



252
253
254
# File 'lib/opencl_ruby_ffi/Arithmetic_gen.rb', line 252

def s0=(value)
 self[:s0] = value
end

#s1Object

Reads the s1 member



248
249
250
# File 'lib/opencl_ruby_ffi/Arithmetic_gen.rb', line 248

def s1
 return self[:s1]
end

#s1=(value) ⇒ Object

Sets the s1 member to value



256
257
258
# File 'lib/opencl_ruby_ffi/Arithmetic_gen.rb', line 256

def s1=(value)
 self[:s1] = value
end

#to_sObject



259
260
261
# File 'lib/opencl_ruby_ffi/Arithmetic_gen.rb', line 259

def to_s
  return "Char2{ #{self[:s0]}, #{self[:s1]} }"
end