ALL, ALL_t

Defined in header <Kokkos_Core.hpp>

Usage

Kokkos::subview(v, i, Kokkos::ALL);
Kokkos::subview(v, i, Kokkos::ALL());

ALL is a slice specifier used with subview() to select all elements along a dimension.

Both Kokkos::ALL and Kokkos::ALL() syntax are supported.

Interface

struct ALL_t

Slice specifier type that can be used with subview() to indicate the full range of indices in a dimension.

KOKKOS_FUNCTION constexpr const ALL_t &operator()() const;

Enables the Kokkos::ALL() syntax.

Returns:

*this

KOKKOS_FUNCTION constexpr bool operator==(const ALL_t&) const;

Equality comparison operator.

Returns:

true

inline constexpr ALL_t ALL{};

Constant instance of ALL_t used to select all indices in a dimension.

Example

Kokkos::View<double**[5]> a("A", N0, N1);

// Select all elements in dimensions 1 and 2, fix dimension 0 to index 5
auto s = Kokkos::subview(a, 5, Kokkos::ALL, Kokkos::ALL);
// Result: s has type View<double[5]> with dimensions (N1, 5)

// Both syntaxes work
auto s1 = Kokkos::subview(a, 5, Kokkos::ALL,   Kokkos::ALL);
auto s2 = Kokkos::subview(a, 5, Kokkos::ALL(), Kokkos::ALL());

See Also

See also

subview

Create subviews of views

pair

Specify a contiguous range of indices