Skip to content

Commit

Permalink
Document BitPackedFloat behavior for zero mantissa bits
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Feb 10, 2023
1 parent 7a63854 commit 768d0a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/llama/mapping/BitPackedFloat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ namespace llama::mapping
= std::conditional_t<mp_contains<FlatRecordDim<RecordDim>, double>::value, std::uint64_t, std::uint32_t>;
} // namespace internal

// TODO(bgruber): I would like to allow zero mantissa bits, which would then no longer support INF. Likewise,
// support to skip the sign bit would also be great.
/// Struct of array mapping using bit packing to reduce size/precision of floating-point data types. The bit layout
/// is [1 sign bit, exponentBits bits from the exponent, mantissaBits bits from the mantissa]+ and tries to follow
/// IEEE 754. Infinity and NAN are supported. If the packed exponent bits are not big enough to hold a number, it
Expand All @@ -189,7 +191,7 @@ namespace llama::mapping
/// \tparam ExponentBits If ExponentBits is llama::Constant<N>, the compile-time N specifies the number of bits to
/// use to store the exponent. If ExponentBits is llama::Value<T>, the number of bits is specified at runtime,
/// passed to the constructor and stored as type T. Must not be zero.
/// \tparam MantissaBits Like ExponentBits but for the mantissa bits. May be zero.
/// \tparam MantissaBits Like ExponentBits but for the mantissa bits. Must not be zero (otherwise values turn INF).
/// \tparam TLinearizeArrayDimsFunctor Defines how the array dimensions should be mapped into linear numbers and
/// how big the linear domain gets.
/// \tparam TStoredIntegral Integral type used as storage of reduced precision floating-point values.
Expand Down

0 comments on commit 768d0a5

Please sign in to comment.