Skip to content

Commit

Permalink
add missing execution space in mdrange (#108)
Browse files Browse the repository at this point in the history
* add missing execution space in mdrange

* unused arg name should be removed in other PR

---------

Co-authored-by: Yuuichi Asahi <[email protected]>
  • Loading branch information
yasahi-hpc and Yuuichi Asahi authored Jul 2, 2024
1 parent cf35a43 commit 16fb3f6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions common/src/KokkosFFT_Helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ void _roll(const ExecutionSpace& exec_space, ViewType& inout,
using point_type = typename range_type::point_type;

range_type range(
point_type{{0, 0}}, point_type{{len0, len1}}, tile_type{{4, 4}}
// [TO DO] Choose optimal tile sizes for each device
exec_space, point_type{{0, 0}}, point_type{{len0, len1}},
tile_type{{4, 4}} // [TO DO] Choose optimal tile sizes for each device
);

axis_type<2> shift0 = {0}, shift1 = {0}, shift2 = {n0 / 2, n1 / 2};
Expand Down
21 changes: 11 additions & 10 deletions common/src/KokkosFFT_padding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ void _crop_or_pad(const ExecutionSpace& exec_space, const InViewType& in,
using tile_type = typename range_type::tile_type;
using point_type = typename range_type::point_type;

range_type range(point_type{{0, 0}}, point_type{{n0, n1}}, tile_type{{4, 4}}
// [TO DO] Choose optimal tile sizes for each device
range_type range(
exec_space, point_type{{0, 0}}, point_type{{n0, n1}}, tile_type{{4, 4}}
// [TO DO] Choose optimal tile sizes for each device
);

Kokkos::parallel_for(
Expand All @@ -160,8 +161,8 @@ void _crop_or_pad(const ExecutionSpace& exec_space, const InViewType& in,
using point_type = typename range_type::point_type;

range_type range(
point_type{{0, 0, 0}}, point_type{{n0, n1, n2}}, tile_type{{4, 4, 4}}
// [TO DO] Choose optimal tile sizes for each device
exec_space, point_type{{0, 0, 0}}, point_type{{n0, n1, n2}},
tile_type{{4, 4, 4}} // [TO DO] Choose optimal tile sizes for each device
);

Kokkos::parallel_for(
Expand Down Expand Up @@ -189,8 +190,8 @@ void _crop_or_pad(const ExecutionSpace& exec_space, const InViewType& in,
using tile_type = typename range_type::tile_type;
using point_type = typename range_type::point_type;

range_type range(point_type{{0, 0, 0, 0}}, point_type{{n0, n1, n2, n3}},
tile_type{{4, 4, 4, 4}}
range_type range(exec_space, point_type{{0, 0, 0, 0}},
point_type{{n0, n1, n2, n3}}, tile_type{{4, 4, 4, 4}}
// [TO DO] Choose optimal tile sizes for each device
);

Expand Down Expand Up @@ -220,7 +221,7 @@ void _crop_or_pad(const ExecutionSpace& exec_space, const InViewType& in,
using tile_type = typename range_type::tile_type;
using point_type = typename range_type::point_type;

range_type range(point_type{{0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4}}, tile_type{{4, 4, 4, 4, 1}}
// [TO DO] Choose optimal tile sizes for each device
);
Expand Down Expand Up @@ -252,7 +253,7 @@ void _crop_or_pad(const ExecutionSpace& exec_space, const InViewType& in,
using tile_type = typename range_type::tile_type;
using point_type = typename range_type::point_type;

range_type range(point_type{{0, 0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4, n5}},
tile_type{{4, 4, 4, 4, 1, 1}}
// [TO DO] Choose optimal tile sizes for each device
Expand Down Expand Up @@ -286,7 +287,7 @@ void _crop_or_pad(const ExecutionSpace& exec_space, const InViewType& in,
using tile_type = typename range_type::tile_type;
using point_type = typename range_type::point_type;

range_type range(point_type{{0, 0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4, n5}},
tile_type{{4, 4, 4, 4, 1, 1}}
// [TO DO] Choose optimal tile sizes for each device
Expand Down Expand Up @@ -323,7 +324,7 @@ void _crop_or_pad(const ExecutionSpace& exec_space, const InViewType& in,
using tile_type = typename range_type::tile_type;
using point_type = typename range_type::point_type;

range_type range(point_type{{0, 0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4, n5}},
tile_type{{4, 4, 4, 4, 1, 1}}
// [TO DO] Choose optimal tile sizes for each device
Expand Down
21 changes: 11 additions & 10 deletions common/src/KokkosFFT_transpose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ void _transpose(const ExecutionSpace& exec_space, InViewType& in,

int n0 = in.extent(0), n1 = in.extent(1);

range_type range(point_type{{0, 0}}, point_type{{n0, n1}}, tile_type{{4, 4}}
// [TO DO] Choose optimal tile sizes for each device
range_type range(
exec_space, point_type{{0, 0}}, point_type{{n0, n1}}, tile_type{{4, 4}}
// [TO DO] Choose optimal tile sizes for each device
);

_prep_transpose_view(in, out, _map);
Expand All @@ -157,8 +158,8 @@ void _transpose(const ExecutionSpace& exec_space, InViewType& in,
int n0 = in.extent(0), n1 = in.extent(1), n2 = in.extent(2);

range_type range(
point_type{{0, 0, 0}}, point_type{{n0, n1, n2}}, tile_type{{4, 4, 4}}
// [TO DO] Choose optimal tile sizes for each device
exec_space, point_type{{0, 0, 0}}, point_type{{n0, n1, n2}},
tile_type{{4, 4, 4}} // [TO DO] Choose optimal tile sizes for each device
);

_prep_transpose_view(in, out, _map);
Expand Down Expand Up @@ -191,8 +192,8 @@ void _transpose(const ExecutionSpace& exec_space, InViewType& in,
int n0 = in.extent(0), n1 = in.extent(1), n2 = in.extent(2),
n3 = in.extent(3);

range_type range(point_type{{0, 0, 0, 0}}, point_type{{n0, n1, n2, n3}},
tile_type{{4, 4, 4, 4}}
range_type range(exec_space, point_type{{0, 0, 0, 0}},
point_type{{n0, n1, n2, n3}}, tile_type{{4, 4, 4, 4}}
// [TO DO] Choose optimal tile sizes for each device
);

Expand Down Expand Up @@ -228,7 +229,7 @@ void _transpose(const ExecutionSpace& exec_space, InViewType& in,
n3 = in.extent(3);
int n4 = in.extent(4);

range_type range(point_type{{0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4}}, tile_type{{4, 4, 4, 4, 1}}
// [TO DO] Choose optimal tile sizes for each device
);
Expand Down Expand Up @@ -266,7 +267,7 @@ void _transpose(const ExecutionSpace& exec_space, InViewType& in,
n3 = in.extent(3);
int n4 = in.extent(4), n5 = in.extent(5);

range_type range(point_type{{0, 0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4, n5}},
tile_type{{4, 4, 4, 4, 1, 1}}
// [TO DO] Choose optimal tile sizes for each device
Expand Down Expand Up @@ -307,7 +308,7 @@ void _transpose(const ExecutionSpace& exec_space, InViewType& in,
n3 = in.extent(3);
int n4 = in.extent(4), n5 = in.extent(5), n6 = in.extent(6);

range_type range(point_type{{0, 0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4, n5}},
tile_type{{4, 4, 4, 4, 1, 1}}
// [TO DO] Choose optimal tile sizes for each device
Expand Down Expand Up @@ -354,7 +355,7 @@ void _transpose(const ExecutionSpace& exec_space, InViewType& in,
int n4 = in.extent(4), n5 = in.extent(5), n6 = in.extent(6),
n7 = in.extent(7);

range_type range(point_type{{0, 0, 0, 0, 0, 0}},
range_type range(exec_space, point_type{{0, 0, 0, 0, 0, 0}},
point_type{{n0, n1, n2, n3, n4, n5}},
tile_type{{4, 4, 4, 4, 1, 1}}
// [TO DO] Choose optimal tile sizes for each device
Expand Down

0 comments on commit 16fb3f6

Please sign in to comment.