Public Types | |
using | VectorType = VectorSingle< word, HostSpace > |
using | VectorTypeHost = VectorSingle< word, HostSpace > |
using | iterator = word * |
using | const_iterator = const word * |
using | reference = word & |
using | const_reference = const word & |
using | value_type = word |
using | pointer = word * |
using | const_pointer = const word * |
using | viewType = ViewType1D< word, HostSpace > |
using | device_type = typename viewType::device_type |
using | memory_space = typename viewType::memory_space |
using | execution_space = typename viewType::execution_space |
Public Member Functions | |
TypeInfoTemplateNV111 ("VectorSingle", word, memoerySpaceName()) | |
Type info. More... | |
VectorSingle ()=default | |
Empty vector. More... | |
VectorSingle (const word &name) | |
Empty vector with a name (capacity = 2) More... | |
VectorSingle (const word &name, uint32 n) | |
Vector with name and size n. More... | |
VectorSingle (const word &name, uint32 n, const word &val) | |
Vector with name, size and value. More... | |
VectorSingle (const word &name, uint32 cap, uint32 n, const RESERVE &r) | |
Vector with name, size (n) and reserved capacity. More... | |
VectorSingle (const word &name, const std::vector< word > &src) | |
Construct with a name and form std::vector (host memory) More... | |
VectorSingle (const word &name, const std::vector< word > &src, uint32 cap) | |
Construct with a name and form std::vector (host memory) and with a desired capacity. More... | |
VectorSingle (const VectorSingle &src)=default | |
Copy construct (performs deep copy) More... | |
VectorSingle (const word &name, const VectorSingle &src) | |
Copy construct with a new name (perform deep copy) More... | |
VectorSingle & | operator= (const VectorSingle &rhs)=default |
Copy assignment (perform deep copy from rhs to *this) More... | |
VectorSingle (VectorSingle &&)=default | |
Move construct. More... | |
VectorSingle & | operator= (VectorSingle &&)=default |
Move assignment. More... | |
~VectorSingle ()=default | |
Descructor This may not destroy the underlying memory, sice view is shared_ptr and maybe referenced by another object too More... | |
INLINE_FUNCTION_H uniquePtr< VectorSingle > | clone () const |
Clone as a uniquePtr (perform deep copy) More... | |
INLINE_FUNCTION_H VectorType & | VectorField () |
Return *this. More... | |
const INLINE_FUNCTION_H VectorType & | VectorField () const |
Return *this. More... | |
INLINE_FUNCTION_H auto & | deviceViewAll () |
Device view range [0,capcity) More... | |
const INLINE_FUNCTION_H auto & | deviceViewAll () const |
Device view range [0,capcity) More... | |
INLINE_FUNCTION_H auto | deviceView () const |
Device view range [0, size) More... | |
INLINE_FUNCTION_H auto | hostViewAll () const |
Return a view accessible on Host in range [0,capacity) More... | |
INLINE_FUNCTION_H auto | hostView () const |
Return a view accessible on Host in range [0,size) More... | |
INLINE_FUNCTION_H word | name () const |
Name of the vector. More... | |
INLINE_FUNCTION_H uint32 | size () const |
Size of the vector. More... | |
INLINE_FUNCTION_H uint32 | capacity () const |
INLINE_FUNCTION_H bool | empty () const |
If vector is empty. More... | |
INLINE_FUNCTION_H void | reserve (uint32 cap) |
Reserve capacity for vector Preserve the content. More... | |
INLINE_FUNCTION_H void | resize (uint32 n) |
Reallocate memory to new cap and set size to 0. More... | |
INLINE_FUNCTION_H void | resize (uint32 n, const word &val) |
Resize the vector and assign the value to it. More... | |
INLINE_FUNCTION_H void | clear () |
Clear the vector, but keep the allocated memory unchanged. More... | |
INLINE_FUNCTION_H void | fill (const word &val) |
Fill the range [0,size) with val. More... | |
INLINE_FUNCTION_H void | fill (rangeU32 r, const word &val) |
INLINE_FUNCTION_H void | assign (size_t n, const word &val) |
Change size of the vector and assign val to vector and. More... | |
INLINE_FUNCTION_H void | assign (const std::vector< word > &src, uint32 cap) |
Assign source vector with specified capacity. More... | |
INLINE_FUNCTION_H void | assign (const std::vector< word > &src) |
Assign source vector. More... | |
INLINE_FUNCTION_H void | assignFromHost (const VectorTypeHost &src) |
Assign source vector from host side. More... | |
INLINE_FUNCTION_H void | assign (const VectorType &src, bool srcCapacity=true) |
template<typename MSpace > | |
INLINE_FUNCTION_H void | assignFromDevice (const VectorSingle< word, MSpace > &src, bool srcCapacity=true) |
INLINE_FUNCTION_H auto | getSpan () |
INLINE_FUNCTION_H auto | getSpan () const |
bool | insertSetElement (const uint32IndexContainer &indices, const word &val) |
bool | insertSetElement (const uint32IndexContainer &indices, const std::vector< word > &vals) |
bool | insertSetElement (const uint32IndexContainer &indices, const ViewType1D< word, memory_space > vals) |
INLINE_FUNCTION_H bool | reorderItems (const uint32IndexContainer &indices) |
void | push_back (const word &val) |
push a new element at the end (host call only) resize if necessary and works on host accessible vector. More... | |
INLINE_FUNCTION_H pointer | data () |
INLINE_FUNCTION_H const_pointer | data () const |
auto | begin () |
Return begin iterator. It works when devices is host accessible. More... | |
const auto | begin () const |
Return begin iterator. it works when host is accessible. More... | |
auto | end () |
const auto | end () const |
Return end iterator. it works when host is accessible. More... | |
word & | operator[] (size_t i) |
Return reference to element i. it works when host is accessible. More... | |
const word & | operator[] (size_t i) const |
FUNCTION_H bool | read (iIstream &is) |
Read vector from stream. More... | |
FUNCTION_H bool | read (iIstream &is, const IOPattern &iop) |
Read vector from stream. More... | |
FUNCTION_H bool | write (iOstream &os, const IOPattern &iop) const |
Write the vector to os. More... | |
FUNCTION_H bool | write (iOstream &os) const |
template<typename HostMask > | |
FUNCTION_H bool | write (iOstream &os, const IOPattern &iop, const HostMask &mask) const |
Static Public Member Functions | |
static constexpr const char * | memoerySpaceName () |
Name of the memory space. More... | |
Private Attributes | |
Vector< word > | container_ |
viewType | unManagedView_ |
Static Private Attributes | |
static constexpr bool | isHostAccessible_ = true |
Is the memory of this vector accessible from Host. More... | |
static constexpr bool | isDeviceAccessible_ = false |
Is the memory of this vector accessiple from Divce. More... | |
static constexpr bool | isTriviallyCopyable_ = false |
Definition at line 31 of file wordVectorHost.hpp.
using VectorType = VectorSingle<word, HostSpace> |
Definition at line 37 of file wordVectorHost.hpp.
using VectorTypeHost = VectorSingle<word, HostSpace> |
Definition at line 39 of file wordVectorHost.hpp.
Definition at line 41 of file wordVectorHost.hpp.
using const_iterator = const word* |
Definition at line 43 of file wordVectorHost.hpp.
Definition at line 45 of file wordVectorHost.hpp.
using const_reference = const word& |
Definition at line 47 of file wordVectorHost.hpp.
using value_type = word |
Definition at line 49 of file wordVectorHost.hpp.
Definition at line 51 of file wordVectorHost.hpp.
using const_pointer = const word* |
Definition at line 53 of file wordVectorHost.hpp.
using viewType = ViewType1D<word, HostSpace> |
Definition at line 57 of file wordVectorHost.hpp.
using device_type = typename viewType::device_type |
Definition at line 59 of file wordVectorHost.hpp.
using memory_space = typename viewType::memory_space |
Definition at line 61 of file wordVectorHost.hpp.
using execution_space = typename viewType::execution_space |
Definition at line 63 of file wordVectorHost.hpp.
|
default |
Empty vector.
|
inlineexplicit |
Empty vector with a name (capacity = 2)
Definition at line 98 of file wordVectorHost.hpp.
|
inline |
Vector with name and size n.
Definition at line 104 of file wordVectorHost.hpp.
|
inline |
Vector with name, size and value.
Definition at line 110 of file wordVectorHost.hpp.
|
inline |
Vector with name, size (n) and reserved capacity.
Definition at line 116 of file wordVectorHost.hpp.
|
inline |
Construct with a name and form std::vector (host memory)
Definition at line 122 of file wordVectorHost.hpp.
|
inline |
Construct with a name and form std::vector (host memory) and with a desired capacity.
Definition at line 128 of file wordVectorHost.hpp.
|
default |
Copy construct (performs deep copy)
|
inline |
Copy construct with a new name (perform deep copy)
Definition at line 137 of file wordVectorHost.hpp.
|
default |
Move construct.
|
default |
Descructor This may not destroy the underlying memory, sice view is shared_ptr and maybe referenced by another object too
TypeInfoTemplateNV111 | ( | "VectorSingle< word, HostSpace >" | , |
word | , | ||
memoerySpaceName() | |||
) |
Type info.
|
default |
Copy assignment (perform deep copy from rhs to *this)
|
default |
Move assignment.
|
inline |
Clone as a uniquePtr (perform deep copy)
Definition at line 159 of file wordVectorHost.hpp.
|
inline |
Return *this.
Definition at line 169 of file wordVectorHost.hpp.
|
inline |
Return *this.
Definition at line 176 of file wordVectorHost.hpp.
|
inline |
Device view range [0,capcity)
Definition at line 183 of file wordVectorHost.hpp.
References Vector< T, Allocator >::capacity().
|
inline |
Device view range [0,capcity)
Definition at line 192 of file wordVectorHost.hpp.
References Vector< T, Allocator >::capacity().
|
inline |
Device view range [0, size)
Definition at line 201 of file wordVectorHost.hpp.
References Vector< T, Allocator >::size().
|
inline |
Return a view accessible on Host in range [0,capacity)
Definition at line 208 of file wordVectorHost.hpp.
References Vector< T, Allocator >::capacity().
|
inline |
Return a view accessible on Host in range [0,size)
Definition at line 216 of file wordVectorHost.hpp.
References Vector< T, Allocator >::size().
|
inline |
Name of the vector.
Definition at line 223 of file wordVectorHost.hpp.
References Vector< T, Allocator >::name().
|
inline |
Size of the vector.
Definition at line 231 of file wordVectorHost.hpp.
References Vector< T, Allocator >::size().
Referenced by geometry::createPropertyId().
|
inline |
Definition at line 239 of file wordVectorHost.hpp.
References Vector< T, Allocator >::capacity().
|
inline |
If vector is empty.
Definition at line 246 of file wordVectorHost.hpp.
References Vector< T, Allocator >::size().
|
inline |
Reserve capacity for vector Preserve the content.
Definition at line 255 of file wordVectorHost.hpp.
References Vector< T, Allocator >::reserve().
|
inline |
Reallocate memory to new cap and set size to 0.
Resize the vector and preserve the content
Definition at line 271 of file wordVectorHost.hpp.
References n.
|
inline |
Resize the vector and assign the value to it.
Definition at line 278 of file wordVectorHost.hpp.
References n.
|
inline |
Clear the vector, but keep the allocated memory unchanged.
Definition at line 285 of file wordVectorHost.hpp.
|
inline |
Fill the range [0,size) with val.
Definition at line 292 of file wordVectorHost.hpp.
References Vector< T, Allocator >::fill().
|
inline |
Definition at line 298 of file wordVectorHost.hpp.
References Range< T >::end(), Vector< T, Allocator >::fill(), and Range< T >::start().
|
inline |
Change size of the vector and assign val to vector and.
Definition at line 305 of file wordVectorHost.hpp.
References n.
|
inline |
Assign source vector with specified capacity.
The size of *this becomes the size of src.
Definition at line 313 of file wordVectorHost.hpp.
References VectorSingle< T, MemorySpace >::assign(), and Vector< T, Allocator >::reserve().
|
inline |
Assign source vector.
The size of *this becomes the size of src. The capacity of *this becomes the capacity of src.
Definition at line 324 of file wordVectorHost.hpp.
|
inline |
Assign source vector from host side.
The size of *this becomes the size of src. The capacity of *this becomes the capacity of src.
Definition at line 333 of file wordVectorHost.hpp.
References fatalExit, and notImplementedFunction.
|
inline |
Definition at line 340 of file wordVectorHost.hpp.
References fatalExit, and notImplementedFunction.
|
inline |
Definition at line 348 of file wordVectorHost.hpp.
References fatalExit, and notImplementedFunction.
|
inline |
Definition at line 364 of file wordVectorHost.hpp.
References Vector< T, Allocator >::size().
|
inline |
Definition at line 370 of file wordVectorHost.hpp.
References Vector< T, Allocator >::size().
bool insertSetElement | ( | const uint32IndexContainer & | indices, |
const word & | val | ||
) |
bool insertSetElement | ( | const uint32IndexContainer & | indices, |
const std::vector< word > & | vals | ||
) |
bool insertSetElement | ( | const uint32IndexContainer & | indices, |
const ViewType1D< word, memory_space > | vals | ||
) |
|
inline |
Definition at line 391 of file wordVectorHost.hpp.
References notImplementedFunction.
|
inline |
push a new element at the end (host call only) resize if necessary and works on host accessible vector.
Definition at line 400 of file wordVectorHost.hpp.
|
inline |
Definition at line 406 of file wordVectorHost.hpp.
|
inline |
Definition at line 411 of file wordVectorHost.hpp.
|
inline |
Return begin iterator. It works when devices is host accessible.
Definition at line 417 of file wordVectorHost.hpp.
|
inline |
Return begin iterator. it works when host is accessible.
Definition at line 423 of file wordVectorHost.hpp.
|
inline |
Definition at line 427 of file wordVectorHost.hpp.
|
inline |
Return end iterator. it works when host is accessible.
Definition at line 432 of file wordVectorHost.hpp.
Return reference to element i. it works when host is accessible.
Definition at line 437 of file wordVectorHost.hpp.
Definition at line 441 of file wordVectorHost.hpp.
|
inline |
Read vector from stream.
Definition at line 449 of file wordVectorHost.hpp.
References Vector< T, Allocator >::read().
Referenced by pFlow::operator>>().
|
inline |
Read vector from stream.
Definition at line 456 of file wordVectorHost.hpp.
References Vector< T, Allocator >::read().
|
inline |
Write the vector to os.
Definition at line 463 of file wordVectorHost.hpp.
References Vector< T, Allocator >::write().
Referenced by pFlow::operator<<().
|
inline |
Definition at line 469 of file wordVectorHost.hpp.
References Vector< T, Allocator >::write().
|
inline |
Definition at line 476 of file wordVectorHost.hpp.
References notImplementedFunction.
|
inlinestaticconstexpr |
Name of the memory space.
Definition at line 485 of file wordVectorHost.hpp.
Definition at line 69 of file wordVectorHost.hpp.
|
mutableprivate |
Definition at line 71 of file wordVectorHost.hpp.
|
staticconstexprprivate |
Is the memory of this vector accessible from Host.
Definition at line 77 of file wordVectorHost.hpp.
|
staticconstexprprivate |
Is the memory of this vector accessiple from Divce.
Definition at line 81 of file wordVectorHost.hpp.
|
staticconstexprprivate |
Definition at line 84 of file wordVectorHost.hpp.