Toggle table of contents sidebar
vector
[DEPRECATED]¶
Header file: <Kokkos_Vector.hpp>
(deprecated in Kokkos 4.3)
The Kokkos Vector is semantically similar to the std::vector, but it is designed to overcome issues with memory allocations and copies when working with devices that have different memory spaces. The Kokkos::Vector
is a Rank-1 DualView that implements the same interface as the std::vector. This allows programs that rely heavily on std::vector to grant access to program data from within a non-host execution space. Note that many of the std::vector compatible functions are host only, so access may be limited based on kernel complexity. Below is a synopsis of the class and the description for each method specifies whether it is supported on the host, device or both.
Kokkos::vector<Scalar, Device> v(n,1); // (deprecated since 4.3) v.push_back(2); v.resize(n+3); v.[n+1] = 3; v.[n+2] = 4;Description¶
Public Typedefs
Scalar value type
Scalar pointer type
Const Scalar pointer type
Scalar reference type
Const Scalar reference type
Iterator type
Const iterator type
Accessors
Accessor
Accessor
Constructors
Construct empty vector
Construct vector of size n + 10% and initialize values to val
Other Public Methods
Resize vector to size n + 10%
Resize vector to size n + 10% and set values to val
Set n values to val
will auto synchronize between host and device
Same as resize (for compatibility)
Resize vector to size() + 1 and set last value to val
Warning
Host only, auto synchronize device
Reduce size() by 1
Set size() to 0
Return number of elements in vector
Return maximum possible number of elements
Return memory used by vector
Returns true if vector is empty
Returns pointer to the underlying array
Returns iterator starting at the beginning
Returns iterator past the last element
Returns reference to the front of the list
Returns reference to the last element in the list
Returns const reference to the front of the list
Returns const reference to the last element in the list
Return the index of largest value satisfying val < comp_val within the range start-theEnd
Return true if the list is sorted
Return iterator pointing to element matching val
Copy data from device to host
Copy data from host to device
Update/synchronize data in dual view from host perspective
Update/synchronize data in dual view from the device perspective
Set the data buffer available at the end of the vector
Returns true if the internal views (host and device) are allocated (non-null pointers).
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