Skip to content

Commit 88fd4f3

Browse files
yasahi-hpcYuuichi Asahi
andauthored
Copy if map is identical in transpose helper (#345)
* fix conflicts * fix * disable some cases to avoid test failures in fft shift * remove unused lines --------- Co-authored-by: Yuuichi Asahi <y.asahi@nr.titech.ac.jp>
1 parent 79ac250 commit 88fd4f3

File tree

2 files changed

+271
-454
lines changed

2 files changed

+271
-454
lines changed

common/src/KokkosFFT_transpose.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <tuple>
1010
#include "KokkosFFT_common_types.hpp"
1111
#include "KokkosFFT_utils.hpp"
12+
#include "KokkosFFT_padding.hpp"
1213

1314
namespace KokkosFFT {
1415
namespace Impl {
@@ -285,8 +286,12 @@ void transpose(const ExecutionSpace& exec_space, const InViewType& in,
285286
"transpose: Rank of View must be equal to Rank of "
286287
"transpose axes.");
287288

288-
KOKKOSFFT_THROW_IF(!KokkosFFT::Impl::is_transpose_needed(map),
289-
"transpose: transpose not necessary");
289+
if (!is_transpose_needed(map)) {
290+
// Just perform deep_copy (Layout may change)
291+
KokkosFFT::Impl::crop_or_pad_impl(
292+
exec_space, in, out, std::make_index_sequence<InViewType::rank()>{});
293+
return;
294+
}
290295

291296
Kokkos::Array<int, InViewType::rank()> map_array = to_array(map);
292297
if ((in.span() >= std::size_t(std::numeric_limits<int>::max())) ||

0 commit comments

Comments
 (0)