OpenKalman
strided_slice.hpp
1 
2 //@HEADER
3 // ************************************************************************
4 //
5 // Kokkos v. 4.0
6 // Copyright (2022) National Technology & Engineering
7 // Solutions of Sandia, LLC (NTESS).
8 //
9 // Under the terms of Contract DE-NA0003525 with NTESS,
10 // the U.S. Government retains certain rights in this software.
11 //
12 // Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
13 // See https://kokkos.org/LICENSE for license information.
14 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
15 //
16 //@HEADER
17 
18 #include <type_traits>
19 
20 namespace std {
21 namespace experimental {
22 
23 namespace {
24  template<class T>
25  struct __mdspan_is_integral_constant: std::false_type {};
26 
27  template<class T, T val>
28  struct __mdspan_is_integral_constant<integral_constant<T,val>>: std::true_type {};
29 }
30 // Slice Specifier allowing for strides and compile time extent
31 template <class OffsetType, class ExtentType, class StrideType>
32 struct strided_slice {
33  using offset_type = OffsetType;
34  using extent_type = ExtentType;
35  using stride_type = StrideType;
36 
37  OffsetType offset;
38  ExtentType extent;
39  StrideType stride;
40 
41  static_assert(is_integral_v<OffsetType> || __mdspan_is_integral_constant<OffsetType>::value);
42  static_assert(is_integral_v<ExtentType> || __mdspan_is_integral_constant<ExtentType>::value);
43  static_assert(is_integral_v<StrideType> || __mdspan_is_integral_constant<StrideType>::value);
44 };
45 
46 } // experimental
47 } // std
Definition: strided_slice.hpp:32
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45