OpenMPCD
Public Member Functions | List of all members
OpenMPCD::CUDA::Bitset Class Reference

Represents a constant-size collection of boolean values. More...

#include <Bitset.hpp>

Public Member Functions

OPENMPCD_CUDA_DEVICE Bitset (const std::size_t bitCount_)
 The constructor. More...
 
OPENMPCD_CUDA_DEVICE ~Bitset ()
 The destructor. More...
 
OPENMPCD_CUDA_DEVICE std::size_t getBitCount () const
 Returns the number of accessible bits. More...
 
OPENMPCD_CUDA_DEVICE void set (const std::size_t bit, const bool value)
 Sets the given bit to the given value. More...
 
OPENMPCD_CUDA_DEVICE bool get (const std::size_t bit) const
 Returns the given bit. More...
 
OPENMPCD_CUDA_DEVICE void setAll (const bool value)
 Sets all bits to the given value. More...
 

Detailed Description

Represents a constant-size collection of boolean values.

Definition at line 21 of file Bitset.hpp.

Constructor & Destructor Documentation

◆ Bitset()

OPENMPCD_CUDA_DEVICE OpenMPCD::CUDA::Bitset::Bitset ( const std::size_t  bitCount_)

The constructor.

The initial value of the bits is unspecified.

Parameters
[in]bitCount_The number of bits to store.

Definition at line 20 of file ImplementationDetails/Bitset.hpp.

◆ ~Bitset()

OPENMPCD_CUDA_DEVICE OpenMPCD::CUDA::Bitset::~Bitset ( )

The destructor.

Definition at line 28 of file ImplementationDetails/Bitset.hpp.

Member Function Documentation

◆ get()

OPENMPCD_CUDA_DEVICE bool OpenMPCD::CUDA::Bitset::get ( const std::size_t  bit) const

Returns the given bit.

This function is thread-safe.

If OPENMPCD_DEBUG is defined, asserts that bit has a valid value.

Parameters
[in]bitThe bit to set, indexed in the range [0, getBitCount()).

Definition at line 58 of file ImplementationDetails/Bitset.hpp.

◆ getBitCount()

OPENMPCD_CUDA_DEVICE std::size_t OpenMPCD::CUDA::Bitset::getBitCount ( ) const

Returns the number of accessible bits.

Definition at line 34 of file ImplementationDetails/Bitset.hpp.

◆ set()

OPENMPCD_CUDA_DEVICE void OpenMPCD::CUDA::Bitset::set ( const std::size_t  bit,
const bool  value 
)

Sets the given bit to the given value.

This function is thread-safe.

If OPENMPCD_DEBUG is defined, asserts that bit has a valid value.

Parameters
[in]bitThe bit to set, indexed in the range [0, getBitCount()).
[in]valueThe value to set the bit to.

Definition at line 40 of file ImplementationDetails/Bitset.hpp.

◆ setAll()

OPENMPCD_CUDA_DEVICE void OpenMPCD::CUDA::Bitset::setAll ( const bool  value)

Sets all bits to the given value.

Parameters
[in]valueThe value to set the bits to.

Definition at line 69 of file ImplementationDetails/Bitset.hpp.


The documentation for this class was generated from the following file: