Kokkos Core Kernels Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Kokkos_Rank.hpp
1 //@HEADER
2 // ************************************************************************
3 //
4 // Kokkos v. 4.0
5 // Copyright (2022) National Technology & Engineering
6 // Solutions of Sandia, LLC (NTESS).
7 //
8 // Under the terms of Contract DE-NA0003525 with NTESS,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
12 // See https://kokkos.org/LICENSE for license information.
13 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 //
15 //@HEADER
16 
17 #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
18 #include <Kokkos_Macros.hpp>
19 static_assert(false,
20  "Including non-public Kokkos header files is not allowed.");
21 #endif
22 #ifndef KOKKOS_KOKKOS_RANK_HPP
23 #define KOKKOS_KOKKOS_RANK_HPP
24 
25 #include <Kokkos_Macros.hpp>
26 #include <Kokkos_Layout.hpp> // Iterate
27 
28 namespace Kokkos {
29 
30 // Iteration Pattern
31 template <unsigned N, Iterate OuterDir = Iterate::Default,
32  Iterate InnerDir = Iterate::Default>
33 struct Rank {
34  static_assert(N != 0u, "Kokkos Error: rank 0 undefined");
35  static_assert(N != 1u,
36  "Kokkos Error: rank 1 is not a multi-dimensional range");
37  static_assert(N < 9u, "Kokkos Error: Unsupported rank...");
38 
39  using iteration_pattern = Rank<N, OuterDir, InnerDir>;
40 
41  static constexpr int rank = N;
42  static constexpr Iterate outer_direction = OuterDir;
43  static constexpr Iterate inner_direction = InnerDir;
44 };
45 
46 } // end namespace Kokkos
47 
48 #endif // KOKKOS_KOKKOS_RANK_HPP
Declaration of various MemoryLayout options.