Traits

Basic Traits

template<typename View>
using KokkosComm::Traits

A common interface to access Kokkos::View-like types.

static bool is_contiguous(const View &v)
Parameters:

v – The View to query

Returns:

true iff the data in the v is contiguous.

static auto data_handle(const View &v)
static size_t span(const View &v)
Returns:

the number of bytes between the beginning of the first byte and the end of the last byte of data in v.

For example, if View was an std::vector<int16_t> of size 3, it would be 6. If the View is non-contiguous, the result includes any “holes” in v.

static constexpr bool is_reference_counted()
Returns:

true iff the type is subject to reference counting (e.g., Kokkos::View)

This is used to determine if asynchronous MPI operations may need to extend the lifetime of this type when it’s used as an argument.

static constexpr size_t rank()
Returns:

the rank (number of dimensions) of the View type

Packing Traits

Strategies for handling non-contiguous views

template<typename View>
using KokkosComm::PackTraits

A common packing-related interface for Kokkos::View-like types.

type packer_type

The Packer to use for this View type.

static bool needs_unpack(const View &v)
Returns:

true iff View v needs to be packed before being passed to MPI

static bool needs_pack(const View &v)
Returns:

true iff View v needs to be unpacked after being passed from MPI