Skip to content

Commit

Permalink
Assert value bits are not zero in BitPackedIntSoA
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jun 30, 2022
1 parent f72a020 commit 7b59c1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/llama/mapping/BitPackedIntSoA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ namespace llama::mapping
/// dimension contains non-integral types, split them off using the \ref Split mapping first.
/// \tparam Bits If Bits is llama::Constant<N>, the compile-time N specifies the number of bits to use. If Bits is
/// an integral type T, the number of bits is specified at runtime, passed to the constructor and stored as type T.
/// Must not be zero.
/// \tparam LinearizeArrayDimsFunctor Defines how the array dimensions should be mapped into linear numbers and how
/// big the linear domain gets.
/// \tparam StoredIntegral Integral type used as storage of reduced precision integers.
Expand Down Expand Up @@ -198,6 +199,7 @@ namespace llama::mapping
: Base(extents)
, VHBits{bits}
{
assert(VHBits::value() > 0);
}

LLAMA_FN_HOST_ACC_INLINE
Expand Down

0 comments on commit 7b59c1e

Please sign in to comment.