Skip to content

Commit

Permalink
add 4 buffer split/dump test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Feb 25, 2021
1 parent bc3c0f7 commit 603a450
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 22 additions & 2 deletions tests/dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using Vec = llama::DS<
>;
using Particle = llama::DS<
llama::DE<tag::Pos, Vec>,
llama::DE<tag::Vel,Vec>,
llama::DE<tag::Vel, Vec>,
llama::DE<tag::Mass, float>,
llama::DE<tag::Flags, llama::DA<bool, 4>>
>;
Expand Down Expand Up @@ -124,8 +124,28 @@ TEST_CASE("dump.Split.AoSoA8.AoS.One.3Buffer")
Particle,
llama::DatumCoord<1>,
llama::mapping::PreconfiguredAoSoA<8>::type,
llama::mapping::PreconfiguredSplit<llama::DatumCoord<0>, llama::mapping::AoS, llama::mapping::One, true>::
llama::mapping::PreconfiguredSplit<llama::DatumCoord<1>, llama::mapping::One, llama::mapping::AoS, true>::
type,
true>{arrayDomain},
"Split.AoSoA8.SoA.One.3Buffer");
}

TEST_CASE("dump.Split.AoSoA8.AoS.One.SoA.4Buffer")
{
// split out velocity as AoSoA8, mass into a single value, position into AoS, and the flags into SoA, makes 4
// buffers
dump(
llama::mapping::Split<
ArrayDomain,
Particle,
llama::DatumCoord<1>,
llama::mapping::PreconfiguredAoSoA<8>::type,
llama::mapping::PreconfiguredSplit<
llama::DatumCoord<1>,
llama::mapping::One,
llama::mapping::
PreconfiguredSplit<llama::DatumCoord<0>, llama::mapping::AoS, llama::mapping::SoA, true>::type,
true>::type,
true>{arrayDomain},
"Split.AoSoA8.AoS.One.SoA.4Buffer");
}
2 changes: 1 addition & 1 deletion tests/splitmapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ TEST_CASE("Split.AoSoA8.AoS.One.SoA.4Buffer")
CHECK(mapping.getBlobNrAndOffset<3, 2>({31}) == llama::NrAndOffset{3, 95});
CHECK(mapping.getBlobNrAndOffset<3, 3>({31}) == llama::NrAndOffset{3, 127});

std::ofstream{"Split.AoSoA8.AoS.One.SoA.4Buffer.svg"} << llama::toSvg(mapping);
// std::ofstream{"Split.AoSoA8.AoS.One.SoA.4Buffer.svg"} << llama::toSvg(mapping);
}

0 comments on commit 603a450

Please sign in to comment.