The Kokkos wrapper class for standard map. More...
#include <KokkosMap.h>
Public Member Functions | |
| auto | begin () |
| Get the beginning writeable iterator of the host map. More... | |
| auto | begin () const |
| Get the beginning const iterator of the host map. More... | |
| auto | end () |
| Get the end writeable iterator of the host map. More... | |
| auto | end () const |
| Get the end const iterator of the host map. More... | |
| auto & | get () |
| Get the underlying writeable host map. More... | |
| const auto & | get () const |
| Get the underlying const host map. More... | |
| void | clear () |
| Clear the underlying data. More... | |
| T2 & | operator[] (const T1 &key) |
| Call host map's operator[]. More... | |
| void | copyToDevice () |
| Copy host map to device. More... | |
| void | copyToDeviceNested () |
| Copy host map to device, perform nested copy for Kokkos arrays. More... | |
| void | swap (MapBase< T1, T2, MapType > &map) |
| Swap with another Kokkos map. More... | |
| KOKKOS_FUNCTION dof_id_type | size () const |
| Get the size of map. More... | |
| KOKKOS_FUNCTION dof_id_type | find (const T1 &key) const |
| Find the index of a key. More... | |
| KOKKOS_FUNCTION bool | exists (const T1 &key) const |
| Get whether a key exists. More... | |
| KOKKOS_FUNCTION const T1 & | key (dof_id_type idx) const |
| Get the key of an index. More... | |
| KOKKOS_FUNCTION const T2 & | value (dof_id_type idx) const |
| Get the value of an index. More... | |
| KOKKOS_FUNCTION const T2 & | operator[] (const T1 &key) const |
| Get the value corresponding to a key. More... | |
| KOKKOS_FUNCTION const T2 & | operator() (const T1 &key) const |
Static Public Attributes | |
| static const dof_id_type | invalid_id = libMesh::DofObject::invalid_id |
Private Member Functions | |
| void | copy () |
| Internal method to copy host map to device. More... | |
Private Attributes | |
| std::shared_ptr< MapType< T1, T2 > > | _map_host |
| Standard map on host Stored as a shared pointer to avoid deep copy. More... | |
| Array< T1 > | _keys |
| Keys on device. More... | |
| Array< T2 > | _values |
| Values on device. More... | |
| Array< dof_id_type > | _offset |
| Beginning offset into device arrays of each bucket. More... | |
Friends | |
| void | dataStore (std::ostream &, MapBase< T1, T2, MapType > &, void *) |
| void | dataLoad (std::istream &, MapBase< T1, T2, MapType > &, void *) |
The Kokkos wrapper class for standard map.
The map can only be populated on host. Make sure to call copyToDevice() or copyToDeviceNested() after populating the map on host.
Definition at line 58 of file KokkosMap.h.
|
inline |
Get the beginning writeable iterator of the host map.
Definition at line 78 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::begin().
|
inline |
Get the beginning const iterator of the host map.
Definition at line 83 of file KokkosMap.h.
| void Moose::Kokkos::MapBase< T1, T2, MapType >::clear | ( | ) |
Clear the underlying data.
Definition at line 244 of file KokkosMap.h.
|
private |
Internal method to copy host map to device.
Definition at line 256 of file KokkosMap.h.
| void Moose::Kokkos::MapBase< T1, T2, MapType >::copyToDevice | ( | ) |
Copy host map to device.
Definition at line 288 of file KokkosMap.h.
| void Moose::Kokkos::MapBase< T1, T2, MapType >::copyToDeviceNested | ( | ) |
Copy host map to device, perform nested copy for Kokkos arrays.
Definition at line 298 of file KokkosMap.h.
|
inline |
Get the end writeable iterator of the host map.
Definition at line 88 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::end().
|
inline |
Get the end const iterator of the host map.
Definition at line 93 of file KokkosMap.h.
|
inline |
Get whether a key exists.
| key | The key |
Definition at line 163 of file KokkosMap.h.
| KOKKOS_FUNCTION dof_id_type Moose::Kokkos::MapBase< T1, T2, MapType >::find | ( | const T1 & | key | ) | const |
Find the index of a key.
| key | The key |
Definition at line 318 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::exists().
|
inline |
Get the underlying writeable host map.
Definition at line 98 of file KokkosMap.h.
Referenced by Moose::Kokkos::dataLoad(), Moose::Kokkos::dataStore(), and Moose::Kokkos::MapBase< unsigned int, unsigned int >::swap().
|
inline |
Get the underlying const host map.
Definition at line 109 of file KokkosMap.h.
|
inline |
Get the key of an index.
| idx | The index returned by find() |
Definition at line 169 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::exists(), Moose::Kokkos::MapBase< unsigned int, unsigned int >::operator()(), and Moose::Kokkos::MapBase< unsigned int, unsigned int >::operator[]().
|
inline |
Definition at line 206 of file KokkosMap.h.
|
inline |
Call host map's operator[].
| key | The key |
Definition at line 125 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::operator()().
|
inline |
Get the value corresponding to a key.
| key | The key |
Definition at line 192 of file KokkosMap.h.
|
inline |
Get the size of map.
Definition at line 146 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::size().
| void Moose::Kokkos::MapBase< T1, T2, MapType >::swap | ( | MapBase< T1, T2, MapType > & | map | ) |
Swap with another Kokkos map.
| map | The Kokkos map to be swapped |
Definition at line 308 of file KokkosMap.h.
|
inline |
Get the value of an index.
| idx | The index returned by find() |
Definition at line 180 of file KokkosMap.h.
|
friend |
Definition at line 348 of file KokkosMap.h.
|
friend |
Definition at line 336 of file KokkosMap.h.
|
private |
Keys on device.
Definition at line 228 of file KokkosMap.h.
Referenced by Moose::Kokkos::dataLoad(), Moose::Kokkos::dataStore(), Moose::Kokkos::MapBase< unsigned int, unsigned int >::key(), Moose::Kokkos::MapBase< unsigned int, unsigned int >::size(), and Moose::Kokkos::MapBase< unsigned int, unsigned int >::swap().
|
mutableprivate |
Standard map on host Stored as a shared pointer to avoid deep copy.
Definition at line 224 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::get().
|
private |
Beginning offset into device arrays of each bucket.
Definition at line 236 of file KokkosMap.h.
Referenced by Moose::Kokkos::dataLoad(), Moose::Kokkos::dataStore(), and Moose::Kokkos::MapBase< unsigned int, unsigned int >::swap().
|
private |
Values on device.
Definition at line 232 of file KokkosMap.h.
Referenced by Moose::Kokkos::dataLoad(), Moose::Kokkos::dataStore(), Moose::Kokkos::MapBase< unsigned int, unsigned int >::swap(), and Moose::Kokkos::MapBase< unsigned int, unsigned int >::value().
|
static |
Definition at line 210 of file KokkosMap.h.
Referenced by Moose::Kokkos::MapBase< unsigned int, unsigned int >::exists(), Moose::Kokkos::MapBase< unsigned int, unsigned int >::key(), and Moose::Kokkos::MapBase< unsigned int, unsigned int >::value().
1.8.14