Class: OpenCL::Bitfield
- Inherits:
-
Object
- Object
- OpenCL::Bitfield
- Defined in:
- lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb,
lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb
Overview
A parent class to represent OpenCL bitfields that use :cl_bitfield
Direct Known Subclasses
CommandQueue::Properties, Device::AffinityDomain, Device::AtomicCapabilities, Device::ExecCapabilities, Device::FPConfig, Device::SVMCapabilities, Device::Type, Kernel::Arg::TypeQualifier, MapFlags, Mem::AllocFlagsINTEL, Mem::Flags, Mem::MigrationFlags, Mem::MigrationFlagsINTEL, Mem::SVMFlags, UnifiedSharedMemoryCapabilitiesINTEL
Instance Method Summary collapse
-
#&(f) ⇒ Object
Returns the bitwise & operation between f and the internal Bitfield representation.
-
#^(f) ⇒ Object
Returns the bitwise ^ operation between f and the internal Bitfield representation.
-
#coerce(other) ⇒ Object
Bitfield should be considered an integer.
-
#flags ⇒ Object
Returns the internal representation of the Bitfield.
-
#flags=(val) ⇒ Object
Sets the internal representation of the Bitfield to val.
-
#include?(flag) ⇒ Boolean
Returns true if flag is bitwise included in the Bitfield.
-
#initialize(val = 0) ⇒ Bitfield
constructor
Initializes a new Bitfield to val.
-
#inspect ⇒ Object
Returns a String corresponding to the Bitfield description.
-
#to_i ⇒ Object
Returns the integer representing the Bitfield value.
-
#to_int ⇒ Object
Returns the integer representing the Bitfield value.
-
#to_s ⇒ Object
Returns a String corresponfing to the Bitfield value.
-
#|(f) ⇒ Object
Returns the bitwise | operation between f and the internal Bitfield representation.
Constructor Details
#initialize(val = 0) ⇒ Bitfield
Initializes a new Bitfield to val
704 705 706 707 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 704 def initialize( val = 0 ) super() @val = val end |
Instance Method Details
#&(f) ⇒ Object
Returns the bitwise & operation between f and the internal Bitfield representation
740 741 742 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 740 def &(f) return self.class::new( @val & f ) end |
#^(f) ⇒ Object
Returns the bitwise ^ operation between f and the internal Bitfield representation
745 746 747 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 745 def ^(f) return self.class::new( @val ^ f ) end |
#coerce(other) ⇒ Object
Bitfield should be considered an integer
735 736 737 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 735 def coerce(other) return [other, self.to_i] end |
#flags ⇒ Object
Returns the internal representation of the Bitfield
755 756 757 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 755 def flags return @val end |
#flags=(val) ⇒ Object
Sets the internal representation of the Bitfield to val
760 761 762 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 760 def flags=(val) @val = val end |
#include?(flag) ⇒ Boolean
Returns true if flag is bitwise included in the Bitfield
710 711 712 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 710 def include?(flag) return ( @val & flag ) == flag end |
#inspect ⇒ Object
Returns a String corresponding to the Bitfield description
715 716 717 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 715 def inspect return "#<#{self.class.name}: #{self}>" end |
#to_i ⇒ Object
Returns the integer representing the Bitfield value
725 726 727 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 725 def to_i return @val end |
#to_int ⇒ Object
Returns the integer representing the Bitfield value
730 731 732 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 730 def to_int return @val end |
#to_s ⇒ Object
Returns a String corresponfing to the Bitfield value
720 721 722 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 720 def to_s return "#{self.names.join('|')}" end |
#|(f) ⇒ Object
Returns the bitwise | operation between f and the internal Bitfield representation
750 751 752 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 750 def |(f) return self.class::new( @val | f ) end |