Class: OpenCL::Half4

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

Overview

Maps the cl_half4 type of OpenCL

Instance Method Summary collapse

Constructor Details

#initialize(s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0) ⇒ Half4

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



1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1347

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

Instance Method Details

#inspectObject



1391
1392
1393
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1391

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

#s0Object

Reads the s0 member



1359
1360
1361
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1359

def s0
 return self[:s0]
end

#s0=(value) ⇒ Object

Sets the s0 member to value



1375
1376
1377
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1375

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

#s1Object

Reads the s1 member



1363
1364
1365
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1363

def s1
 return self[:s1]
end

#s1=(value) ⇒ Object

Sets the s1 member to value



1379
1380
1381
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1379

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

#s2Object

Reads the s2 member



1367
1368
1369
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1367

def s2
 return self[:s2]
end

#s2=(value) ⇒ Object

Sets the s2 member to value



1383
1384
1385
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1383

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

#s3Object

Reads the s3 member



1371
1372
1373
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1371

def s3
 return self[:s3]
end

#s3=(value) ⇒ Object

Sets the s3 member to value



1387
1388
1389
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1387

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

#to_sObject



1395
1396
1397
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1395

def to_s
  return "Half4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
end