Toggle table of contents sidebar
DynamicView
¶
Header file: <Kokkos_DynamicView.hpp>
A potentially reference-counted rank 1 array, without layout, that can be dynamically resized on the host.
Public Member Variables
Whether the reference type is a C++ lvalue reference.
Public Nested Typedefs
Kokkos::ViewTraits
parent class type.
DynamicView
type templated on traits::data_type
and traits::device_type
.
DynamicView
type templated on traits::const_data_type
and traits::device_type
.
DynamicView
type templated on traits::non_const_data_type
and traits::device_type
.
The compatible view type with the same DataType
and LayoutType
stored in host accessible memory space.
Public Data Handle Types
The return type of the view access operators.
The pointer to scalar type.
Constructors
The default Constructor. No allocations are made, no reference counting happens. All extents are zero and its data pointer is NULL.
The copy constructor from a compatible View. Follows View assignment rules.
The move constructor.
The standard allocating constructor.
arg_label – a user-provided label, which is used for profiling and debugging purposes. Names are not required to be unique.
min_chunk_size – a user-provided minimum chunk size needed for memory allocation, will be raised to nearest power-of-two for more efficient memory access operations.
max_extent – a user-provided maximum size, required to allocate a chunk-pointer array.
The resize_serial
method must be called after construction to reserve the desired amount of memory, bound by max_extent
.
Public Data Access Functions
A value of reference_type
which may or not be referenceable itself. The number of index arguments must be 1 (for non-deprecated code).
Data Resizing, Dimensions, Strides
Resizes the DynamicView with sufficient chunks of memory of chunk_size
to store the requested number of elements n
. This method can only be called outside of parallel regions. n
is restricted to be smaller than the max_extent
value passed to the DynamicView constructor. This method must be called after the construction of the DynamicView as the constructor sets the requested sizes for chunk_size
and max_extent
, but does not take input for the actual amount of memory to be used.
The total size of the product of the number of chunks multiplied by the chunk size. This may be larger than size
as this includes the total size for the total number of complete chunks of memory.
The number of entries a chunk of memory may store, always a power of two.
The number of entries available in the allocation based on the number passed to resize_serial
. This number is bound by allocation_extent
.
The extent of the specified dimension. iType
must be an integral type, and dim
must be smaller than rank
. Returns 1 for rank > 1.
The extent of the specified dimension as an int
. iType
must be an integral type, and dim
must be smaller than rank
. Compared to extent
this function can be useful on architectures where int
operations are more efficient than size_t
. It also may eliminate the need for type casts in applications that otherwise perform all index operations with int
. Returns 1 for rank > 1.
The stride of the specified dimension, always returns 0 for DynamicView
.
The stride of dimension 0, always returns 0 for DynamicView
s.
The stride of dimension 1, always returns 0 for DynamicView
s.
The stride of dimension 2, always returns 0 for DynamicView
s.
The stride of dimension 3, always returns 0 for DynamicView
s.
The stride of dimension 4, always returns 0 for DynamicView
s.
The stride of dimension 5, always returns 0 for DynamicView
s.
The stride of dimension 6, always returns 0 for DynamicView
s.
The stride of dimension 7, always returns 0 for DynamicView
s.
Always returns 0 for DynamicView
s.
The pointer to the underlying data allocation.
The span is contiguous, always false for DynamicView
s.
Other
The current reference count of the underlying allocation.
The label of the DynamicView
.
True if the View points to a valid set of allocated memory chunks. Note that this will return false until resize_serial is called with a size greater than 0.
const int chunk_size = 16*1024; Kokkos::Experimental::DynamicView<double*> view("v", chunk_size, 10*chunk_size); view.resize_serial(3*chunk_size); Kokkos::parallel_for("InitializeData", 3*chunk_size, KOKKOS_LAMBDA ( const int i) { view(i) = i; });
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4