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

◆ of()

template<TensorElement T>
constexpr TensorDType MayaFlux::Kakshya::TensorDType::of ( )
inlinestaticnodiscardconstexprnoexcept

Type for a C++ scalar or complex element.

Definition at line 73 of file TensorDType.hpp.

74 {
75 constexpr auto width = static_cast<uint8_t>(sizeof(T) * 8);
76 if constexpr (std::same_as<T, bool>) {
77 return { .kind = TensorDTypeKind::BOOL, .bits = 8, .lanes = 1 };
78 } else if constexpr (std::is_floating_point_v<T>) {
79 return { .kind = TensorDTypeKind::FLOAT, .bits = width, .lanes = 1 };
80 } else if constexpr (std::is_integral_v<T>) {
81 return { .kind = std::is_signed_v<T> ? TensorDTypeKind::INT : TensorDTypeKind::UINT, .bits = width, .lanes = 1 };
82 } else {
83 return { .kind = TensorDTypeKind::COMPLEX, .bits = width, .lanes = 1 };
84 }
85 }

References MayaFlux::Kakshya::BOOL, MayaFlux::Kakshya::COMPLEX, MayaFlux::Kakshya::FLOAT, MayaFlux::Kakshya::INT, and MayaFlux::Kakshya::UINT.

Referenced by is(), and MayaFlux::Yantra::TensorKernels::pack_weights().

Here is the caller graph for this function: