Class: OpenCL::UChar2

Inherits:
Struct
  • Object
show all
Defined in:
lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb

Overview

Maps the cl_uchar2 type of OpenCL

Instance Method Summary collapse

Constructor Details

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

Creates a new UChar2 with members set to 0 or to the user specified values. If a Pointer is passed as the first argument, UChar2 maps the memory pointed.



387
388
389
390
391
392
393
394
395
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 387

def initialize( s0 = 0, s1 = 0 )
  if s0.is_a?(FFI::Pointer) then
    super(s0)
  else
    super()
    self[:s0] = s0
    self[:s1] = s1
  end
end

Instance Method Details

#inspectObject



413
414
415
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 413

def inspect
  return "#<#{self.class.name}: #{self[:s0]}, #{self[:s1]}>"
end

#s0Object

Reads the s0 member



397
398
399
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 397

def s0
 return self[:s0]
end

#s0=(value) ⇒ Object

Sets the s0 member to value



405
406
407
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 405

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

#s1Object

Reads the s1 member



401
402
403
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 401

def s1
 return self[:s1]
end

#s1=(value) ⇒ Object

Sets the s1 member to value



409
410
411
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 409

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

#to_sObject



417
418
419
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 417

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