MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ storage_bytes()

std::optional< size_t > MayaFlux::Kakshya::TensorDType::storage_bytes ( uint64_t count) const
nodiscardnoexcept

Packed bytes needed for count elements.

Returns
Byte count, or std::nullopt on overflow or a zero-width type.

Definition at line 5 of file TensorDType.cpp.

6{
7 const size_t width = element_bits();
8 if (width == 0 || count > (std::numeric_limits<size_t>::max() - 7) / width)
9 return std::nullopt;
10 return (static_cast<size_t>(count) * width + 7) / 8;
11}
constexpr size_t element_bits() const noexcept
Bits of one element, lanes included.

References element_bits().

Here is the call graph for this function: