VTK-m
2.0
|
#include <BitField.h>
Classes | |
struct | ExecutionTypes |
Public Types | |
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 | 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... | |
Public Member Functions | |
VTKM_CONT | BitField () |
VTKM_CONT | BitField (const BitField &)=default |
VTKM_CONT | BitField (BitField &&) noexcept=default |
VTKM_CONT | ~BitField ()=default |
VTKM_CONT BitField & | operator= (const BitField &)=default |
VTKM_CONT BitField & | operator= (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... | |
VTKM_CONT vtkm::Id | GetNumberOfBits () const |
Return the number of bits stored by this BitField. More... | |
template<typename WordType > | |
VTKM_CONT vtkm::Id | GetNumberOfWords () const |
Return the number of words (of WordType) stored in this bit fields. 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 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 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 ReadPortalType | PrepareForInput (vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const |
Prepares this BitField to be used as an input to an operation in the execution environment. More... | |
VTKM_CONT WritePortalType | PrepareForOutput (vtkm::Id numBits, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const |
Prepares (allocates) this BitField to be used as an output from an operation in the execution environment. More... | |
VTKM_CONT WritePortalType | PrepareForInPlace (vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const |
Prepares this BitField to be used in an in-place operation (both as input and output) in the execution environment. More... | |
Private Member Functions | |
VTKM_CONT void | FillImpl (const void *word, vtkm::BufferSizeType wordSize, vtkm::cont::Token &token) const |
Private Attributes | |
vtkm::cont::internal::Buffer | Buffer |
Static Private Attributes | |
static constexpr vtkm::Id | BlockSize = detail::BitFieldTraits::BlockSize |
using vtkm::cont::BitField::IsValidWordType = detail::BitFieldTraits::IsValidWordType<WordType> |
Check whether a word type is valid for non-atomic operations.
using vtkm::cont::BitField::IsValidWordTypeAtomic = detail::BitFieldTraits::IsValidWordTypeAtomic<WordType> |
Check whether a word type is valid for atomic operations.
using vtkm::cont::BitField::ReadPortalType = detail::BitPortalConst |
A read-only BitPortal used in the control environment.
using vtkm::cont::BitField::WritePortalType = detail::BitPortal |
The BitPortal used in the control environment.
VTKM_CONT vtkm::cont::BitField::BitField | ( | ) |
|
default |
VTKM_CONT void vtkm::cont::BitField::Allocate | ( | vtkm::Id | numberOfBits, |
vtkm::CopyFlag | preserve, | ||
vtkm::cont::Token & | token | ||
) | const |
Allocate the requested number of bits.
|
inline |
Allocate the requested number of bits.
|
inline |
|
inline |
Allocate the requested number of bits and fill with the requested bit or word.
|
inline |
|
inline |
Set all the bits to the given value.
|
inline |
|
inline |
Set subsequent words to the given word of bits.
|
private |
|
inline |
Return the internal Buffer
used to store the BitField
.
Return the number of bits stored by this BitField.
|
inline |
Return the number of words (of WordType) stored in this bit fields.
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.
|
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.
VTKM_CONT WritePortalType vtkm::cont::BitField::PrepareForInPlace | ( | vtkm::cont::DeviceAdapterId | device, |
vtkm::cont::Token & | token | ||
) | const |
Prepares this BitField to be used in an in-place operation (both as input and output) in the execution environment.
If necessary, copies data to the execution environment. Can throw an exception if this BitField does not yet contain any data. Returns a portal that can be used in code running in the execution environment.
VTKM_CONT ReadPortalType vtkm::cont::BitField::PrepareForInput | ( | vtkm::cont::DeviceAdapterId | device, |
vtkm::cont::Token & | token | ||
) | const |
VTKM_CONT WritePortalType vtkm::cont::BitField::PrepareForOutput | ( | vtkm::Id | numBits, |
vtkm::cont::DeviceAdapterId | device, | ||
vtkm::cont::Token & | token | ||
) | const |
Prepares (allocates) this BitField to be used as an output from an operation in the execution environment.
The internal state of this class is set to have valid data in the execution BitField with the assumption that the array will be filled soon (i.e. before any other methods of this object are called). Returns a portal that can be used in code running in the execution environment.
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.
VTKM_CONT void vtkm::cont::BitField::ReleaseResources | ( | ) |
Release all resources held by this BitField and reset to empty.
VTKM_CONT void vtkm::cont::BitField::ReleaseResourcesExecution | ( | ) |
Release all execution-side resources held by this BitField.
VTKM_CONT void vtkm::cont::BitField::SyncControlArray | ( | ) | const |
Force the control array to sync with the last-used device.
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.
|
staticconstexprprivate |
|
mutableprivate |