Class: OpenCL::Bitfield
- Inherits:
-
Object
- Object
- OpenCL::Bitfield
- Defined in:
- lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.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.
-
#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.
-
#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
694 695 696 697 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 694 def initialize( val = 0 ) super() @val = val end |
Instance Method Details
#&(f) ⇒ Object
Returns the bitwise & operation between f and the internal Bitfield representation
721 722 723 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 721 def &(f) return self.class::new( @val & f ) end |
#^(f) ⇒ Object
Returns the bitwise ^ operation between f and the internal Bitfield representation
726 727 728 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 726 def ^(f) return self.class::new( @val ^ f ) end |
#flags ⇒ Object
Returns the internal representation of the Bitfield
736 737 738 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 736 def flags return @val end |
#flags=(val) ⇒ Object
Setss the internal representation of the Bitfield to val
741 742 743 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 741 def flags=(val) @val = val end |
#include?(flag) ⇒ Boolean
Returns true if flag is bitwise included in the Bitfield
700 701 702 703 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 700 def include?(flag) return true if ( @val & flag ) == flag return false end |
#to_i ⇒ Object
Returns the integer representing the Bitfield value
711 712 713 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 711 def to_i return @val end |
#to_int ⇒ Object
Returns the integer representing the Bitfield value
716 717 718 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 716 def to_int return @val end |
#to_s ⇒ Object
Returns a String corresponfing to the Bitfield value
706 707 708 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 706 def to_s return "#{self.names}" end |
#|(f) ⇒ Object
Returns the bitwise | operation between f and the internal Bitfield representation
731 732 733 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 731 def |(f) return self.class::new( @val | f ) end |