-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kokkos parallel for can only handle up to 6 dimensions. There are multiple workarounds. This is the simplest. It uses a `parallel_for` for the first 6 dimensions and a normal for for any other dimensions. This allows the transposition to be carried out for the TokamAxi geometry See merge request gysela-developpers/gyselalibxx!738 --------------------------------------------
- Loading branch information
1 parent
843bfd6
commit 6ba879a
Showing
3 changed files
with
93 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
#pragma once | ||
|
||
namespace detail { | ||
|
||
template < | ||
class TypeSeqIn, | ||
std::size_t Start, | ||
std::size_t End, | ||
std::size_t Idx = 0, | ||
class TypeSeqOut = ddc::detail::TypeSeq<>> | ||
struct TypeSeqRange | ||
{ | ||
static_assert(End <= ddc::type_seq_size_v<TypeSeqIn>); | ||
using new_result_type = std::conditional_t< | ||
(Start <= Idx) && (Idx < End), | ||
ddc::type_seq_merge_t< | ||
TypeSeqOut, | ||
ddc::detail::TypeSeq<ddc::type_seq_element_t<Idx, TypeSeqIn>>>, | ||
TypeSeqOut>; | ||
using type = typename TypeSeqRange<TypeSeqIn, Start, End, Idx + 1, new_result_type>::type; | ||
}; | ||
|
||
template <class TypeSeqIn, std::size_t Start, std::size_t End, class TypeSeqOut> | ||
struct TypeSeqRange<TypeSeqIn, Start, End, End, TypeSeqOut> | ||
{ | ||
using type = TypeSeqOut; | ||
}; | ||
|
||
} // namespace detail | ||
|
||
/// A tool to get a subset of a TypeSeq by slicing [Start:End] | ||
template <class TypeSeqIn, std::size_t Start, std::size_t End> | ||
using type_seq_range_t = typename detail::TypeSeqRange<TypeSeqIn, Start, End, Start>::type; |