Skip to content

Commit 51b98e1

Browse files
committedMar 29, 2024
Get rid of now unnecessary use of is_layouttiled trait
1 parent e2cfdec commit 51b98e1

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed
 

‎containers/src/Kokkos_DynRankView.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1657,8 +1657,7 @@ KOKKOS_FUNCTION auto as_view_of_rank_n(
16571657

16581658
if constexpr (std::is_same_v<decltype(layout), Kokkos::LayoutLeft> ||
16591659
std::is_same_v<decltype(layout), Kokkos::LayoutRight> ||
1660-
std::is_same_v<decltype(layout), Kokkos::LayoutStride> ||
1661-
is_layouttiled<decltype(layout)>::value) {
1660+
std::is_same_v<decltype(layout), Kokkos::LayoutStride>) {
16621661
for (int i = N; i < 7; ++i)
16631662
layout.dimension[i] = KOKKOS_IMPL_CTOR_DEFAULT_ARG;
16641663
}

‎core/src/Kokkos_CopyViews.hpp

+8-18
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,8 @@ void view_copy(const ExecutionSpace& space, const DstType& dst,
539539
int64_t strides[DstType::rank + 1];
540540
dst.stride(strides);
541541
Kokkos::Iterate iterate;
542-
if (Kokkos::is_layouttiled<typename DstType::array_layout>::value) {
543-
iterate = Kokkos::layout_iterate_type_selector<
544-
typename DstType::array_layout>::outer_iteration_pattern;
545-
} else if (std::is_same<typename DstType::array_layout,
546-
Kokkos::LayoutRight>::value) {
542+
if (std::is_same<typename DstType::array_layout,
543+
Kokkos::LayoutRight>::value) {
547544
iterate = Kokkos::Iterate::Right;
548545
} else if (std::is_same<typename DstType::array_layout,
549546
Kokkos::LayoutLeft>::value) {
@@ -630,11 +627,8 @@ void view_copy(const DstType& dst, const SrcType& src) {
630627
int64_t strides[DstType::rank + 1];
631628
dst.stride(strides);
632629
Kokkos::Iterate iterate;
633-
if (Kokkos::is_layouttiled<typename DstType::array_layout>::value) {
634-
iterate = Kokkos::layout_iterate_type_selector<
635-
typename DstType::array_layout>::outer_iteration_pattern;
636-
} else if (std::is_same<typename DstType::array_layout,
637-
Kokkos::LayoutRight>::value) {
630+
if (std::is_same<typename DstType::array_layout,
631+
Kokkos::LayoutRight>::value) {
638632
iterate = Kokkos::Iterate::Right;
639633
} else if (std::is_same<typename DstType::array_layout,
640634
Kokkos::LayoutLeft>::value) {
@@ -3092,8 +3086,7 @@ inline std::enable_if_t<
30923086
std::is_same<typename Kokkos::View<T, P...>::array_layout,
30933087
Kokkos::LayoutRight>::value ||
30943088
std::is_same<typename Kokkos::View<T, P...>::array_layout,
3095-
Kokkos::LayoutStride>::value ||
3096-
is_layouttiled<typename Kokkos::View<T, P...>::array_layout>::value>
3089+
Kokkos::LayoutStride>::value>
30973090
impl_resize(const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop,
30983091
Kokkos::View<T, P...>& v,
30993092
const typename Kokkos::View<T, P...>::array_layout& layout) {
@@ -3139,8 +3132,7 @@ inline std::enable_if_t<
31393132
std::is_same<typename Kokkos::View<T, P...>::array_layout,
31403133
Kokkos::LayoutRight>::value ||
31413134
std::is_same<typename Kokkos::View<T, P...>::array_layout,
3142-
Kokkos::LayoutStride>::value ||
3143-
is_layouttiled<typename Kokkos::View<T, P...>::array_layout>::value)>
3135+
Kokkos::LayoutStride>::value)>
31443136
impl_resize(const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop,
31453137
Kokkos::View<T, P...>& v,
31463138
const typename Kokkos::View<T, P...>::array_layout& layout) {
@@ -3308,8 +3300,7 @@ inline std::enable_if_t<
33083300
std::is_same<typename Kokkos::View<T, P...>::array_layout,
33093301
Kokkos::LayoutRight>::value ||
33103302
std::is_same<typename Kokkos::View<T, P...>::array_layout,
3311-
Kokkos::LayoutStride>::value ||
3312-
is_layouttiled<typename Kokkos::View<T, P...>::array_layout>::value>
3303+
Kokkos::LayoutStride>::value>
33133304
impl_realloc(Kokkos::View<T, P...>& v,
33143305
const typename Kokkos::View<T, P...>::array_layout& layout,
33153306
const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop) {
@@ -3351,8 +3342,7 @@ inline std::enable_if_t<
33513342
std::is_same<typename Kokkos::View<T, P...>::array_layout,
33523343
Kokkos::LayoutRight>::value ||
33533344
std::is_same<typename Kokkos::View<T, P...>::array_layout,
3354-
Kokkos::LayoutStride>::value ||
3355-
is_layouttiled<typename Kokkos::View<T, P...>::array_layout>::value)>
3345+
Kokkos::LayoutStride>::value)>
33563346
impl_realloc(Kokkos::View<T, P...>& v,
33573347
const typename Kokkos::View<T, P...>::array_layout& layout,
33583348
const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop) {

‎core/src/Kokkos_View.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -1442,8 +1442,7 @@ class View : public ViewTraits<DataType, Properties...> {
14421442
std::is_same_v<typename traits::array_layout,
14431443
Kokkos::LayoutRight> ||
14441444
std::is_same_v<typename traits::array_layout,
1445-
Kokkos::LayoutStride> ||
1446-
is_layouttiled<typename traits::array_layout>::value) {
1445+
Kokkos::LayoutStride>) {
14471446
size_t i0 = arg_layout.dimension[0];
14481447
size_t i1 = arg_layout.dimension[1];
14491448
size_t i2 = arg_layout.dimension[2];
@@ -1495,8 +1494,7 @@ class View : public ViewTraits<DataType, Properties...> {
14951494
std::is_same_v<typename traits::array_layout,
14961495
Kokkos::LayoutRight> ||
14971496
std::is_same_v<typename traits::array_layout,
1498-
Kokkos::LayoutStride> ||
1499-
is_layouttiled<typename traits::array_layout>::value) {
1497+
Kokkos::LayoutStride>) {
15001498
size_t i0 = arg_layout.dimension[0];
15011499
size_t i1 = arg_layout.dimension[1];
15021500
size_t i2 = arg_layout.dimension[2];

0 commit comments

Comments
 (0)