Class: OpenCL::Short8

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

Overview

Maps the cl_short8 type of OpenCL

Instance Method Summary collapse

Constructor Details

#initialize(s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0) ⇒ Short8

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



1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1590

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

Instance Method Details

#inspectObject



1670
1671
1672
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1670

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

#s0Object

Reads the s0 member



1606
1607
1608
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1606

def s0
 return self[:s0]
end

#s0=(value) ⇒ Object

Sets the s0 member to value



1638
1639
1640
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1638

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

#s1Object

Reads the s1 member



1610
1611
1612
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1610

def s1
 return self[:s1]
end

#s1=(value) ⇒ Object

Sets the s1 member to value



1642
1643
1644
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1642

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

#s2Object

Reads the s2 member



1614
1615
1616
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1614

def s2
 return self[:s2]
end

#s2=(value) ⇒ Object

Sets the s2 member to value



1646
1647
1648
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1646

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

#s3Object

Reads the s3 member



1618
1619
1620
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1618

def s3
 return self[:s3]
end

#s3=(value) ⇒ Object

Sets the s3 member to value



1650
1651
1652
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1650

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

#s4Object

Reads the s4 member



1622
1623
1624
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1622

def s4
 return self[:s4]
end

#s4=(value) ⇒ Object

Sets the s4 member to value



1654
1655
1656
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1654

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

#s5Object

Reads the s5 member



1626
1627
1628
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1626

def s5
 return self[:s5]
end

#s5=(value) ⇒ Object

Sets the s5 member to value



1658
1659
1660
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1658

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

#s6Object

Reads the s6 member



1630
1631
1632
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1630

def s6
 return self[:s6]
end

#s6=(value) ⇒ Object

Sets the s6 member to value



1662
1663
1664
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1662

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

#s7Object

Reads the s7 member



1634
1635
1636
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1634

def s7
 return self[:s7]
end

#s7=(value) ⇒ Object

Sets the s7 member to value



1666
1667
1668
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1666

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

#to_sObject



1674
1675
1676
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1674

def to_s
  return "Short8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
end