Class: OpenCL::UInt8

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

Overview

Maps the cl_uint8 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) ⇒ UInt8

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



1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1869

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



1949
1950
1951
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1949

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



1885
1886
1887
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1885

def s0
 return self[:s0]
end

#s0=(value) ⇒ Object

Sets the s0 member to value



1917
1918
1919
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1917

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

#s1Object

Reads the s1 member



1889
1890
1891
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1889

def s1
 return self[:s1]
end

#s1=(value) ⇒ Object

Sets the s1 member to value



1921
1922
1923
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1921

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

#s2Object

Reads the s2 member



1893
1894
1895
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1893

def s2
 return self[:s2]
end

#s2=(value) ⇒ Object

Sets the s2 member to value



1925
1926
1927
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1925

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

#s3Object

Reads the s3 member



1897
1898
1899
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1897

def s3
 return self[:s3]
end

#s3=(value) ⇒ Object

Sets the s3 member to value



1929
1930
1931
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1929

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

#s4Object

Reads the s4 member



1901
1902
1903
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1901

def s4
 return self[:s4]
end

#s4=(value) ⇒ Object

Sets the s4 member to value



1933
1934
1935
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1933

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

#s5Object

Reads the s5 member



1905
1906
1907
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1905

def s5
 return self[:s5]
end

#s5=(value) ⇒ Object

Sets the s5 member to value



1937
1938
1939
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1937

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

#s6Object

Reads the s6 member



1909
1910
1911
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1909

def s6
 return self[:s6]
end

#s6=(value) ⇒ Object

Sets the s6 member to value



1941
1942
1943
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1941

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

#s7Object

Reads the s7 member



1913
1914
1915
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1913

def s7
 return self[:s7]
end

#s7=(value) ⇒ Object

Sets the s7 member to value



1945
1946
1947
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1945

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

#to_sObject



1953
1954
1955
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 1953

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