Class: OpenCL::Float16

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

Overview

Maps the cl_float16 type of OpenCL

Instance Method Summary collapse

Constructor Details

#initialize(s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0, s8 = 0.0, s9 = 0.0, sa = 0.0, sb = 0.0, sc = 0.0, sd = 0.0, se = 0.0, sf = 0.0) ⇒ Float16

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



3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3747

def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0, s5 = 0.0, s6 = 0.0, s7 = 0.0, s8 = 0.0, s9 = 0.0, sa = 0.0, sb = 0.0, sc = 0.0, sd = 0.0, se = 0.0, sf = 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
    self[:s4] = s4
    self[:s5] = s5
    self[:s6] = s6
    self[:s7] = s7
    self[:s8] = s8
    self[:s9] = s9
    self[:sa] = sa
    self[:sb] = sb
    self[:sc] = sc
    self[:sd] = sd
    self[:se] = se
    self[:sf] = sf
  end
end

Instance Method Details

#inspectObject



3899
3900
3901
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3899

def inspect
  return "#<#{self.class.name}: #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]}>"
end

#s0Object

Reads the s0 member



3771
3772
3773
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3771

def s0
 return self[:s0]
end

#s0=(value) ⇒ Object

Sets the s0 member to value



3835
3836
3837
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3835

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

#s1Object

Reads the s1 member



3775
3776
3777
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3775

def s1
 return self[:s1]
end

#s1=(value) ⇒ Object

Sets the s1 member to value



3839
3840
3841
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3839

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

#s2Object

Reads the s2 member



3779
3780
3781
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3779

def s2
 return self[:s2]
end

#s2=(value) ⇒ Object

Sets the s2 member to value



3843
3844
3845
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3843

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

#s3Object

Reads the s3 member



3783
3784
3785
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3783

def s3
 return self[:s3]
end

#s3=(value) ⇒ Object

Sets the s3 member to value



3847
3848
3849
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3847

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

#s4Object

Reads the s4 member



3787
3788
3789
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3787

def s4
 return self[:s4]
end

#s4=(value) ⇒ Object

Sets the s4 member to value



3851
3852
3853
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3851

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

#s5Object

Reads the s5 member



3791
3792
3793
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3791

def s5
 return self[:s5]
end

#s5=(value) ⇒ Object

Sets the s5 member to value



3855
3856
3857
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3855

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

#s6Object

Reads the s6 member



3795
3796
3797
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3795

def s6
 return self[:s6]
end

#s6=(value) ⇒ Object

Sets the s6 member to value



3859
3860
3861
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3859

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

#s7Object

Reads the s7 member



3799
3800
3801
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3799

def s7
 return self[:s7]
end

#s7=(value) ⇒ Object

Sets the s7 member to value



3863
3864
3865
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3863

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

#s8Object

Reads the s8 member



3803
3804
3805
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3803

def s8
 return self[:s8]
end

#s8=(value) ⇒ Object

Sets the s8 member to value



3867
3868
3869
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3867

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

#s9Object

Reads the s9 member



3807
3808
3809
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3807

def s9
 return self[:s9]
end

#s9=(value) ⇒ Object

Sets the s9 member to value



3871
3872
3873
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3871

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

#saObject

Reads the sa member



3811
3812
3813
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3811

def sa
 return self[:sa]
end

#sa=(value) ⇒ Object

Sets the sa member to value



3875
3876
3877
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3875

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

#sbObject

Reads the sb member



3815
3816
3817
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3815

def sb
 return self[:sb]
end

#sb=(value) ⇒ Object

Sets the sb member to value



3879
3880
3881
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3879

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

#scObject

Reads the sc member



3819
3820
3821
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3819

def sc
 return self[:sc]
end

#sc=(value) ⇒ Object

Sets the sc member to value



3883
3884
3885
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3883

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

#sdObject

Reads the sd member



3823
3824
3825
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3823

def sd
 return self[:sd]
end

#sd=(value) ⇒ Object

Sets the sd member to value



3887
3888
3889
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3887

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

#seObject

Reads the se member



3827
3828
3829
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3827

def se
 return self[:se]
end

#se=(value) ⇒ Object

Sets the se member to value



3891
3892
3893
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3891

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

#sfObject

Reads the sf member



3831
3832
3833
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3831

def sf
 return self[:sf]
end

#sf=(value) ⇒ Object

Sets the sf member to value



3895
3896
3897
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3895

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

#to_sObject



3903
3904
3905
# File 'lib/opencl_ruby_ffi/opencl_arithmetic_gen.rb', line 3903

def to_s
  return "Float16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
end