Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that static ArrayExtents and One mapping are stateless #417

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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