Skip to content

Commit

Permalink
check that static ArrayExtents and One mapping are stateless
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Nov 26, 2021
1 parent e7f6322 commit f7cecf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions include/llama/ArrayExtents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ namespace llama
static_assert(std::is_trivially_move_constructible_v<ArrayExtents<1>>);
static_assert(std::is_trivially_copy_assignable_v<ArrayExtents<1>>);
static_assert(std::is_trivially_move_assignable_v<ArrayExtents<1>>);
static_assert(std::is_empty_v<ArrayExtents<1>>);

template<std::size_t... SizesA, std::size_t... SizesB>
LLAMA_FN_HOST_ACC_INLINE constexpr auto operator==(ArrayExtents<SizesA...> a, ArrayExtents<SizesB...> b) -> bool
Expand Down
7 changes: 1 addition & 6 deletions tests/virtualrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,7 @@ TEST_CASE("VirtualRecord.One.size")
{
using Mapping = llama::mapping::MinAlignedOne<llama::ArrayExtents<>, Particle>;
STATIC_REQUIRE(Mapping{}.blobSize(0) == 56);

struct S : Mapping::ArrayIndex
{
char c;
};
STATIC_REQUIRE(sizeof(S) == sizeof(char));
STATIC_REQUIRE(std::is_empty_v<Mapping::ArrayIndex>);

[[maybe_unused]] const auto v = llama::allocViewStack<0, Particle>();
STATIC_REQUIRE(std::is_same_v<typename decltype(v)::Mapping, Mapping>);
Expand Down

0 comments on commit f7cecf6

Please sign in to comment.