VTK-m  1.8
Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
vtkm::cont::BitField Class Reference

#include <BitField.h>

Classes

struct  ExecutionTypes
 

Public Types

using data = ArrayHandle< vtkm::WordTypeDefault, StorageTagBasic >
 
using WritePortalType = detail::BitPortal
 The BitPortal used in the control environment. More...
 
using ReadPortalType = detail::BitPortalConst
 A read-only BitPortal used in the control environment. More...
 
using instead = detail::BitPortal
 
using instead = detail::BitPortalConst
 
using WordTypePreferred = vtkm::AtomicTypePreferred
 
template<typename WordType >
using IsValidWordType = detail::BitFieldTraits::IsValidWordType< WordType >
 Check whether a word type is valid for non-atomic operations. More...
 
template<typename WordType , typename Device = void>
using IsValidWordTypeAtomic = detail::BitFieldTraits::IsValidWordTypeAtomic< WordType >
 Check whether a word type is valid for atomic operations. More...
 
using instead = detail::BitFieldTraits::IsValidWordTypeAtomic< WordType >
 

Public Member Functions

VTKM_CONT BitField ()
 
VTKM_CONT BitField (const BitField &)=default
 
VTKM_CONT BitField (BitField &&) noexcept=default
 
VTKM_CONT ~BitField ()=default
 
VTKM_CONT BitFieldoperator= (const BitField &)=default
 
VTKM_CONT BitFieldoperator= (BitField &&) noexcept=default
 
VTKM_CONT bool operator== (const BitField &rhs) const
 
VTKM_CONT bool operator!= (const BitField &rhs) const
 
VTKM_CONT vtkm::cont::internal::Buffer GetBuffer () const
 Return the internal Buffer used to store the BitField. More...
 
template<typename WordType >
VTKM_CONT VTKM_DEPRECATED(1.6, "BitField now uses a Buffer to store data.") ArrayHandle< vtkm VTKM_CONT vtkm::Id GetNumberOfWords () const
 Return the internal ArrayHandle used to store the BitField. More...
 
VTKM_CONT void Allocate (vtkm::Id numberOfBits, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
 Allocate the requested number of bits. More...
 
VTKM_CONT void Allocate (vtkm::Id numberOfBits, vtkm::CopyFlag preserve=vtkm::CopyFlag::Off) const
 Allocate the requested number of bits. More...
 
template<typename ValueType >
VTKM_CONT void AllocateAndFill (vtkm::Id numberOfBits, ValueType value, vtkm::cont::Token &token) const
 Allocate the requested number of bits and fill with the requested bit or word. More...
 
template<typename ValueType >
VTKM_CONT void AllocateAndFill (vtkm::Id numberOfBits, ValueType value) const
 
template<typename WordType >
VTKM_CONT void Fill (WordType word, vtkm::cont::Token &token) const
 Set subsequent words to the given word of bits. More...
 
template<typename WordType >
VTKM_CONT void Fill (WordType word) const
 
VTKM_CONT void Fill (bool value, vtkm::cont::Token &token) const
 Set all the bits to the given value. More...
 
VTKM_CONT void Fill (bool value) const
 
VTKM_CONT VTKM_DEPRECATED (1.6, "Use Allocate with preserve = On.") void Shrink(vtkm
 Shrink the bit field to the requested number of bits. More...
 
VTKM_CONT void ReleaseResourcesExecution ()
 Release all execution-side resources held by this BitField. More...
 
VTKM_CONT void ReleaseResources ()
 Release all resources held by this BitField and reset to empty. More...
 
VTKM_CONT void SyncControlArray () const
 Force the control array to sync with the last-used device. More...
 
VTKM_CONT bool IsOnDevice (vtkm::cont::DeviceAdapterId device) const
 Returns true if the BitField's data is on the given device. More...
 
VTKM_CONT bool IsOnHost () const
 Returns true if the BitField's data is on the host. More...
 
VTKM_CONT VTKM_DEPRECATED(1.6, "Data can be on multiple devices. Use IsOnDevice.") vtkm VTKM_CONT WritePortalType WritePortal () const
 Get a portal to the data that is usable from the control environment. More...
 
VTKM_CONT ReadPortalType ReadPortal () const
 Get a read-only portal to the data that is usable from the control environment. More...
 
VTKM_CONT VTKM_DEPRECATED (1.6, "Use BitField::WritePortal() instead. " "Note that the returned portal will lock the array while it is in scope.") detail
 

Private Member Functions

VTKM_CONT void FillImpl (const void *word, vtkm::BufferSizeType wordSize, vtkm::cont::Token &token) const
 

Static Private Attributes

static constexpr vtkm::Id BlockSize = detail::BitFieldTraits::BlockSize
 

Member Typedef Documentation

◆ data

◆ instead [1/3]

using vtkm::cont::BitField::instead = detail::BitPortal

◆ instead [2/3]

using vtkm::cont::BitField::instead = detail::BitPortalConst

◆ instead [3/3]

using vtkm::cont::BitField::instead = detail::BitFieldTraits::IsValidWordTypeAtomic<WordType>

◆ IsValidWordType

template<typename WordType >
using vtkm::cont::BitField::IsValidWordType = detail::BitFieldTraits::IsValidWordType<WordType>

Check whether a word type is valid for non-atomic operations.

◆ IsValidWordTypeAtomic

template<typename WordType , typename Device = void>
using vtkm::cont::BitField::IsValidWordTypeAtomic = detail::BitFieldTraits::IsValidWordTypeAtomic<WordType>

Check whether a word type is valid for atomic operations.

◆ ReadPortalType

using vtkm::cont::BitField::ReadPortalType = detail::BitPortalConst

A read-only BitPortal used in the control environment.

◆ WordTypePreferred

◆ WritePortalType

using vtkm::cont::BitField::WritePortalType = detail::BitPortal

The BitPortal used in the control environment.

Constructor & Destructor Documentation

◆ BitField() [1/3]

VTKM_CONT vtkm::cont::BitField::BitField ( )

◆ BitField() [2/3]

VTKM_CONT vtkm::cont::BitField::BitField ( const BitField )
default

◆ BitField() [3/3]

VTKM_CONT vtkm::cont::BitField::BitField ( BitField &&  )
defaultnoexcept

◆ ~BitField()

VTKM_CONT vtkm::cont::BitField::~BitField ( )
default

Member Function Documentation

◆ Allocate() [1/2]

VTKM_CONT void vtkm::cont::BitField::Allocate ( vtkm::Id  numberOfBits,
vtkm::CopyFlag  preserve,
vtkm::cont::Token token 
) const

Allocate the requested number of bits.

◆ Allocate() [2/2]

VTKM_CONT void vtkm::cont::BitField::Allocate ( vtkm::Id  numberOfBits,
vtkm::CopyFlag  preserve = vtkm::CopyFlag::Off 
) const
inline

Allocate the requested number of bits.

◆ AllocateAndFill() [1/2]

template<typename ValueType >
VTKM_CONT void vtkm::cont::BitField::AllocateAndFill ( vtkm::Id  numberOfBits,
ValueType  value 
) const
inline

◆ AllocateAndFill() [2/2]

template<typename ValueType >
VTKM_CONT void vtkm::cont::BitField::AllocateAndFill ( vtkm::Id  numberOfBits,
ValueType  value,
vtkm::cont::Token token 
) const
inline

Allocate the requested number of bits and fill with the requested bit or word.

◆ Fill() [1/4]

VTKM_CONT void vtkm::cont::BitField::Fill ( bool  value) const
inline

◆ Fill() [2/4]

VTKM_CONT void vtkm::cont::BitField::Fill ( bool  value,
vtkm::cont::Token token 
) const
inline

Set all the bits to the given value.

◆ Fill() [3/4]

template<typename WordType >
VTKM_CONT void vtkm::cont::BitField::Fill ( WordType  word) const
inline

◆ Fill() [4/4]

template<typename WordType >
VTKM_CONT void vtkm::cont::BitField::Fill ( WordType  word,
vtkm::cont::Token token 
) const
inline

Set subsequent words to the given word of bits.

◆ FillImpl()

VTKM_CONT void vtkm::cont::BitField::FillImpl ( const void *  word,
vtkm::BufferSizeType  wordSize,
vtkm::cont::Token token 
) const
private

◆ GetBuffer()

VTKM_CONT vtkm::cont::internal::Buffer vtkm::cont::BitField::GetBuffer ( ) const
inline

Return the internal Buffer used to store the BitField.

◆ GetNumberOfWords()

template<typename WordType >
VTKM_CONT VTKM_DEPRECATED (1.6, "BitField now uses a Buffer to store data.") ArrayHandle<vtkm VTKM_CONT vtkm::Id vtkm::cont::BitField::GetNumberOfWords ( ) const
inline

Return the internal ArrayHandle used to store the BitField.

Return the number of words (of WordType) stored in this bit fields.

◆ IsOnDevice()

VTKM_CONT bool vtkm::cont::BitField::IsOnDevice ( vtkm::cont::DeviceAdapterId  device) const

Returns true if the BitField's data is on the given device.

If the data are on the given device, then preparing for that device should not require any data movement.

◆ IsOnHost()

VTKM_CONT bool vtkm::cont::BitField::IsOnHost ( ) const
inline

Returns true if the BitField's data is on the host.

If the data are on the given device, then calling ReadPortal or WritePortal should not require any data movement.

◆ operator!=()

VTKM_CONT bool vtkm::cont::BitField::operator!= ( const BitField rhs) const
inline

◆ operator=() [1/2]

VTKM_CONT BitField& vtkm::cont::BitField::operator= ( BitField &&  )
defaultnoexcept

◆ operator=() [2/2]

VTKM_CONT BitField& vtkm::cont::BitField::operator= ( const BitField )
default

◆ operator==()

VTKM_CONT bool vtkm::cont::BitField::operator== ( const BitField rhs) const
inline

◆ ReadPortal()

VTKM_CONT ReadPortalType vtkm::cont::BitField::ReadPortal ( ) const

Get a read-only portal to the data that is usable from the control environment.

As long as this portal is in scope, no one else will be able to write in the BitField.

◆ ReleaseResources()

VTKM_CONT void vtkm::cont::BitField::ReleaseResources ( )

Release all resources held by this BitField and reset to empty.

◆ ReleaseResourcesExecution()

VTKM_CONT void vtkm::cont::BitField::ReleaseResourcesExecution ( )

Release all execution-side resources held by this BitField.

◆ SyncControlArray()

VTKM_CONT void vtkm::cont::BitField::SyncControlArray ( ) const

Force the control array to sync with the last-used device.

◆ VTKM_DEPRECATED() [1/2]

VTKM_CONT vtkm::cont::BitField::VTKM_DEPRECATED ( 1.  6)
inline

Shrink the bit field to the requested number of bits.

◆ VTKM_DEPRECATED() [2/2]

VTKM_CONT vtkm::cont::BitField::VTKM_DEPRECATED ( 1.  6,
"Use BitField::WritePortal() instead. " "Note that the returned portal will lock the array while it is in scope."   
)
inline

◆ WritePortal()

VTKM_CONT VTKM_DEPRECATED (1.6, "Data can be on multiple devices. Use IsOnDevice.") vtkm VTKM_CONT WritePortalType vtkm::cont::BitField::WritePortal ( ) const

Get a portal to the data that is usable from the control environment.

As long as this portal is in scope, no one else will be able to read or write the BitField.

Member Data Documentation

◆ BlockSize

constexpr vtkm::Id vtkm::cont::BitField::BlockSize = detail::BitFieldTraits::BlockSize
staticconstexprprivate

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