Skip to content

Commit

Permalink
Merge pull request #487 from lanl/pgrete/mdrange-tiling
Browse files Browse the repository at this point in the history
Add default tiling matching  index range to MDRange loop pattern.
  • Loading branch information
pgrete authored Apr 14, 2021
2 parents df73344 + 6fffe07 commit 2617728
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Changed (changing behavior/API/variables/...)

### Fixed (not changing behavior/API/variables/...)
- [[PR 487]](https://github.com/lanl/parthenon/pull/487) Add default tiling matching `i` index range to MDRange loop pattern.

### Infrastructure (changes irrelevant to downstream codes)
- [[PR 488]](https://github.com/lanl/parthenon/pull/488) Update GitLab Dockerfile to use HDF5 version 1.10.7
Expand Down
23 changes: 13 additions & 10 deletions src/kokkos_abstraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ par_dispatch(LoopPatternMDRange, const std::string &name, DevExecSpace exec_spac
const Function &function, Args &&... args) {
using namespace dispatch_impl;
typename DispatchType<Args...>::type tag;
kokkos_dispatch(
tag, name,
Kokkos::Experimental::require(
Kokkos::MDRangePolicy<Kokkos::Rank<2>>(exec_space, {jl, il}, {ju + 1, iu + 1}),
Kokkos::Experimental::WorkItemProperty::HintLightWeight),
function, std::forward<Args>(args)...);
kokkos_dispatch(tag, name,
Kokkos::Experimental::require(
Kokkos::MDRangePolicy<Kokkos::Rank<2>>(
exec_space, {jl, il}, {ju + 1, iu + 1}, {1, iu + 1 - il}),
Kokkos::Experimental::WorkItemProperty::HintLightWeight),
function, std::forward<Args>(args)...);
}

// 3D loop using Kokkos 1D Range
Expand Down Expand Up @@ -226,7 +226,8 @@ par_dispatch(LoopPatternMDRange, const std::string &name, DevExecSpace exec_spac
kokkos_dispatch(tag, name,
Kokkos::Experimental::require(
Kokkos::MDRangePolicy<Kokkos::Rank<3>>(exec_space, {kl, jl, il},
{ku + 1, ju + 1, iu + 1}),
{ku + 1, ju + 1, iu + 1},
{1, 1, iu + 1 - il}),
Kokkos::Experimental::WorkItemProperty::HintLightWeight),
function, std::forward<Args>(args)...);
}
Expand Down Expand Up @@ -348,7 +349,8 @@ par_dispatch(LoopPatternMDRange, const std::string &name, DevExecSpace exec_spac
kokkos_dispatch(tag, name,
Kokkos::Experimental::require(
Kokkos::MDRangePolicy<Kokkos::Rank<4>>(
exec_space, {nl, kl, jl, il}, {nu + 1, ku + 1, ju + 1, iu + 1}),
exec_space, {nl, kl, jl, il}, {nu + 1, ku + 1, ju + 1, iu + 1},
{1, 1, 1, iu + 1 - il}),
Kokkos::Experimental::WorkItemProperty::HintLightWeight),
function, std::forward<Args>(args)...);
}
Expand Down Expand Up @@ -452,8 +454,9 @@ par_dispatch(LoopPatternMDRange, const std::string &name, DevExecSpace exec_spac
kokkos_dispatch(
tag, name,
Kokkos::Experimental::require(
Kokkos::MDRangePolicy<Kokkos::Rank<5>>(
exec_space, {ml, nl, kl, jl, il}, {mu + 1, nu + 1, ku + 1, ju + 1, iu + 1}),
Kokkos::MDRangePolicy<Kokkos::Rank<5>>(exec_space, {ml, nl, kl, jl, il},
{mu + 1, nu + 1, ku + 1, ju + 1, iu + 1},
{1, 1, 1, 1, iu + 1 - il}),
Kokkos::Experimental::WorkItemProperty::HintLightWeight),
function, std::forward<Args>(args)...);
}
Expand Down

0 comments on commit 2617728

Please sign in to comment.