Skip to content

Commit

Permalink
add split AoS layout
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Apr 30, 2021
1 parent 8b9da9e commit b640488
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions examples/cuda/nbody/nbody.cu
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ try
return "AoSoA" + std::to_string(AOSOA_LANES);
if (m == 4)
return "Split SoA";
if (m == 5)
return "Split AoS";
std::abort();
};
auto title = "GM " + mappingName(Mapping);
if (useSharedMemory)
Expand All @@ -194,6 +197,14 @@ try
llama::mapping::PreconfiguredSoA<>::type,
llama::mapping::PreconfiguredSoA<>::type,
true>{arrayDims};
if constexpr (Mapping == 5)
return llama::mapping::Split<
decltype(arrayDims),
Particle,
llama::RecordCoord<1>,
llama::mapping::PreconfiguredAoS<>::type,
llama::mapping::PreconfiguredAoS<>::type,
true>{arrayDims};
}();

Stopwatch watch;
Expand Down Expand Up @@ -472,8 +483,8 @@ try
plotFile << "\"\"\t\"update\"\t\"move\"\n";

using namespace boost::mp11;
mp_for_each<mp_iota_c<5>>([&](auto i) { run<decltype(i)::value, 0>(plotFile, false); });
mp_for_each<mp_iota_c<5>>(
mp_for_each<mp_iota_c<6>>([&](auto i) { run<decltype(i)::value, 0>(plotFile, false); });
mp_for_each<mp_iota_c<6>>(
[&](auto i)
{ mp_for_each<mp_iota_c<4>>([&](auto j) { run<decltype(i)::value, decltype(j)::value>(plotFile, true); }); });
manual::run(plotFile);
Expand Down

0 comments on commit b640488

Please sign in to comment.