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::ExecCapabilities, Device::FPConfig, Device::SVMCapabilities, Device::Type, Kernel::Arg::TypeQualifier, MapFlags, Mem::Flags, Mem::MigrationFlags, Mem::SVMFlags
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
Setss 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
680 681 682 683 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 680 def initialize( val = 0 ) super() @val = val end |
Instance Method Details
#&(f) ⇒ Object
Returns the bitwise & operation between f and the internal Bitfield representation
717 718 719 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 717 def &(f) return self.class::new( @val & f ) end |
#^(f) ⇒ Object
Returns the bitwise ^ operation between f and the internal Bitfield representation
722 723 724 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 722 def ^(f) return self.class::new( @val ^ f ) end |
#coerce(other) ⇒ Object
Bitfield should be considered an integer
712 713 714 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 712 def coerce(other) return [other, self.to_i] end |
#flags ⇒ Object
Returns the internal representation of the Bitfield
732 733 734 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 732 def flags return @val end |
#flags=(val) ⇒ Object
Setss the internal representation of the Bitfield to val
737 738 739 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 737 def flags=(val) @val = val end |
#include?(flag) ⇒ Boolean
Returns true if flag is bitwise included in the Bitfield
686 687 688 689 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 686 def include?(flag) return true if ( @val & flag ) == flag return false end |
#inspect ⇒ Object
Returns a String corresponding to the Bitfield description
692 693 694 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 692 def inspect return "#<#{self.class.name}: #{self}>" end |
#to_i ⇒ Object
Returns the integer representing the Bitfield value
702 703 704 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 702 def to_i return @val end |
#to_int ⇒ Object
Returns the integer representing the Bitfield value
707 708 709 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 707 def to_int return @val end |
#to_s ⇒ Object
Returns a String corresponfing to the Bitfield value
697 698 699 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 697 def to_s return "#{self.names.join('|')}" end |
#|(f) ⇒ Object
Returns the bitwise | operation between f and the internal Bitfield representation
727 728 729 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 727 def |(f) return self.class::new( @val | f ) end |