|
void | add_stream_dependencies (std::vector< Stream > streams) |
| Declare a dependencies on the multiple streams at one time. More...
|
|
void | add_stream_dependency (Stream stream) |
| Declare a dependency on the passed stream. More...
|
|
YAKL_INLINE T * | begin () const |
| Returns pointer to beginning of the data. More...
|
|
YAKL_INLINE T * | data () const |
| Returns the raw data pointer of this array object. More...
|
|
template<class TLOC = T, typename std::enable_if< std::is_const< TLOC >::value, int >::type = 0> |
void | deallocate () |
| If owned, decrement the reference counter; if ref counter reaches zero, deallocate memory; If non-owned, does nothing. More...
|
|
template<class TLOC = T, typename std::enable_if< ! std::is_const< TLOC >::value, int >::type = 0> |
void | deallocate () |
| If owned, decrement the reference counter; if ref counter reaches zero, deallocate memory; If non-owned, does nothing. More...
|
|
template<int theirRank, int theirStyle> |
void | deep_copy_to (Array< typename std::remove_cv< T >::type, theirRank, memDevice, theirStyle > const &lhs, Stream stream=Stream()) const |
| [ASYNCHRONOUS] [DEEP_COPY] Copy this array's contents to a yakl::memDevice array. More...
|
|
template<int theirRank, int theirStyle> |
void | deep_copy_to (Array< typename std::remove_cv< T >::type, theirRank, memHost, theirStyle > const &lhs, Stream stream=Stream()) const |
| [ASYNCHRONOUS] [DEEP_COPY] Copy this array's contents to a yakl::memHost array. More...
|
|
YAKL_INLINE T * | end () const |
| Returns pointer to end of the data. More...
|
|
YAKL_INLINE T * | get_data () const |
| Returns the raw data pointer of this array object. More...
|
|
YAKL_INLINE index_t | get_elem_count () const |
| Returns the total number of elements in this array object. More...
|
|
YAKL_INLINE int | get_memory_space () const |
| Returns this array object's string label if the YAKL_DEBUG CPP macro is defined. Otherwise, returns an empty string. More...
|
|
YAKL_INLINE int | get_rank () const |
| Returns the number of dimensions in this array object. More...
|
|
YAKL_INLINE index_t | get_totElems () const |
| Returns the total number of elements in this array object. More...
|
|
YAKL_INLINE bool | initialized () const |
| Returns whether this array object has is in an initialized / allocated state. More...
|
|
const char * | label () const |
|
YAKL_INLINE index_t | size () const |
| Returns the total number of elements in this array object. More...
|
|
YAKL_INLINE bool | span_is_contiguous () const |
| Always true. yakl::Array objects are always contiguous in memory with no padding. More...
|
|
YAKL_INLINE index_t | totElems () const |
| Returns the total number of elements in this array object. More...
|
|
int | use_count () const |
| Returns how many array objects share this pointer if owned; or 0 if unowned. More...
|
|
template<class T, int rank, int myMem, int myStyle>
class yakl::ArrayBase< T, rank, myMem, myStyle >
This class implements functionality common to both yakl::styleC and yakl::styleFortran Array
objects.
- Parameters
-
template<class T , int rank, int myMem, int myStyle>
void yakl::ArrayBase< T, rank, myMem, myStyle >::add_stream_dependencies |
( |
std::vector< Stream > |
streams | ) |
|
|
inline |
Declare a dependencies on the multiple streams at one time.
Upon deallocation, an event is placed in each stream this array depends on. The data pointer is not released from the pool until all dependent events complete. This avoids potential pointer aliasing of Arrays potentially being used simultaneous in different parallel streams. The pool allocator is non-blocking, so erroneous aliasing can occur if the user uses multiple streams, deallocates and allocates during runtime, and does not use this function.
template<class T , int rank, int myMem, int myStyle>
Declare a dependency on the passed stream.
Upon deallocation, an event is placed in each stream this array depends on. The data pointer is not released from the pool until all dependent events complete. This avoids potential pointer aliasing of Arrays potentially being used simultaneous in different parallel streams. The pool allocator is non-blocking, so erroneous aliasing can occur if the user uses multiple streams, deallocates and allocates during runtime, and does not use this function.
template<class T , int rank, int myMem, int myStyle>
template<class TLOC = T, typename std::enable_if< std::is_const< TLOC >::value, int >::type = 0>
If owned, decrement the reference counter; if ref counter reaches zero, deallocate memory; If non-owned, does nothing.
If the reference counter reaches zero, meaning no other array objects are sharing this data pointer, the deallocate the data. This routine has the same effect as assigning this array object to an empty array object. This is safe to call even if this array object is not yet allocated.
template<class T , int rank, int myMem, int myStyle>
template<class TLOC = T, typename std::enable_if< ! std::is_const< TLOC >::value, int >::type = 0>
If owned, decrement the reference counter; if ref counter reaches zero, deallocate memory; If non-owned, does nothing.
If the reference counter reaches zero, meaning no other array objects are sharing this data pointer, the deallocate the data. This routine has the same effect as assigning this array object to an empty array object. This is safe to call even if this array object is not yet allocated.
template<class T , int rank, int myMem, int myStyle>
template<int theirRank, int theirStyle>
[ASYNCHRONOUS] [DEEP_COPY] Copy this array's contents to a yakl::memDevice array.
Arrays must have the same type and total number of elements. No checking of rank, style, or dimensionality is performed. Both arrays must be allocated. this
array may be in yakl::memHost or yakl::memDevice space.
template<class T , int rank, int myMem, int myStyle>
template<int theirRank, int theirStyle>
[ASYNCHRONOUS] [DEEP_COPY] Copy this array's contents to a yakl::memHost array.
Arrays must have the same type and total number of elements. No checking of rank, style, or dimensionality is performed. Both arrays must be allocated. this
array may be in yakl::memHost or yakl::memDevice space.
template<class T , int rank, int myMem, int myStyle>
Returns how many array objects share this pointer if owned; or 0
if unowned.
Returns the use count for this array object's data pointer. I.e., this is how many yakl::Array objects currently share this data pointer. If this returns a value of 0
, that means that this array object is not being reference counted, meaning it performed no allocation upon creation, will perform no deallocation upon destruction, and has no control over whether the memory pointed to by the data pointer stays allocated or not.