A view into an association map data structure that can be passed to kernels. The AssociationMapView provides access to the underlying data of an AssociationMap without owning it. It allows for efficient retrieval of associated values for given keys, making it suitable for use inside kernels.
Public Functions
-
ALPAKA_FN_ACC inline auto extents() const
Get the extents of the association map.
- Returns:
An Extents struct containing the number of values and keys in the association map.
-
ALPAKA_FN_ACC inline auto operator[](size_t key)
Get the associated values for a given key.
- Parameters:
- size_t key
The key for which to get the associated values.
- Returns:
A span containing the values associated with the given key.
-
ALPAKA_FN_ACC inline auto operator[](size_t key) const
Get the associated values for a given key.
- Parameters:
- size_t key
The key for which to get the associated values.
- Returns:
A span containing the values associated with the given key.
-
ALPAKA_FN_ACC inline auto count(std::size_t key) const
Get the number of associated values for a given key.
- Parameters:
- std::size_t key
The key for which to get the count of associated values.
- Returns:
The number of values associated with the given key.
-
ALPAKA_FN_ACC inline bool contains(std::size_t key) const
Check if there are any associated values for a given key.
- Parameters:
- std::size_t key
The key to check for associated values.
- Returns:
True if there are associated values for the given key, false otherwise.
-
struct Extents
Public Members
-
std::size_t keys
-
std::size_t values