14namespace stratax::core {
28namespace dtype_detail {
42#define STRATAX_DEFINE_DTYPE_TRAITS(TYPE, KIND, NAME) \
45 struct DTypeTraitsImpl<TYPE> \
48 static constexpr DTypeKind kind = DTypeKind::KIND; \
49 static constexpr std::size_t bits = sizeof(type) * CHAR_BIT; \
50 static constexpr int digits = std::numeric_limits<type>::digits; \
51 static constexpr std::string_view name = NAME; \
57#define STRATAX_DEFINE_FLOAT_DTYPE_TRAITS(TYPE, RANK, NAME) \
60 struct DTypeTraitsImpl<TYPE> \
63 static constexpr DTypeKind kind = DTypeKind::Floating; \
64 static constexpr std::size_t bits = sizeof(type) * CHAR_BIT; \
65 static constexpr int digits = std::numeric_limits<type>::digits; \
66 static constexpr std::size_t rank = RANK; \
67 static constexpr std::string_view name = NAME; \
76#define STRATAX_DEFINE_COMPLEX_DTYPE_TRAITS(TYPE, COMPONENT, RANK, NAME) \
79 struct DTypeTraitsImpl<TYPE> \
82 using component_type = COMPONENT; \
83 static constexpr DTypeKind kind = DTypeKind::Complex; \
84 static constexpr std::size_t bits = sizeof(type) * CHAR_BIT; \
85 static constexpr int digits = std::numeric_limits<component_type>::digits; \
86 static constexpr std::size_t rank = RANK; \
87 static constexpr std::string_view name = NAME; \
110#undef STRATAX_DEFINE_DTYPE_TRAITS
111#undef STRATAX_DEFINE_FLOAT_DTYPE_TRAITS
112#undef STRATAX_DEFINE_COMPLEX_DTYPE_TRAITS
135#define STRATAX_DEFINE_COMPLEX_COMPONENT(COMPLEX, REAL) \
138 struct ComplexComponent<COMPLEX> \
147#undef STRATAX_DEFINE_COMPLEX_COMPONENT
163#define STRATAX_DEFINE_COMPLEX_FROM_REAL(REAL, COMPLEX) \
166 struct ComplexFromReal<REAL> \
168 using type = COMPLEX; \
175#undef STRATAX_DEFINE_COMPLEX_FROM_REAL
typename ComplexComponent< std::remove_cvref_t< T > >::type complex_component_t
Underlying real dtype of a complex dtype.
#define STRATAX_DEFINE_FLOAT_DTYPE_TRAITS(TYPE, RANK, NAME)
Defines metadata for a ranked floating-point Stratax dtype.
#define STRATAX_DEFINE_DTYPE_TRAITS(TYPE, KIND, NAME)
Defines metadata for a non-complex Stratax dtype.
DTypeKind
Identifies the general category of a Stratax dtype.
#define STRATAX_DEFINE_COMPLEX_FROM_REAL(REAL, COMPLEX)
Defines a real-to-complex dtype specialization.
#define STRATAX_DEFINE_COMPLEX_DTYPE_TRAITS(TYPE, COMPONENT, RANK, NAME)
Defines metadata for a complex Stratax dtype.
#define STRATAX_DEFINE_COMPLEX_COMPONENT(COMPLEX, REAL)
Defines a complex-to-real component specialization.
typename ComplexFromReal< std::remove_cvref_t< T > >::type complex_from_real_t
Complex dtype corresponding to a real floating-point dtype.
Supported scalar dtype aliases.
std::int32_t int32
Signed 32-bit integer dtype.
std::uint8_t uint8
Unsigned 8-bit integer dtype.
std::uint16_t uint16
Unsigned 16-bit integer dtype.
std::complex< long double > clongdouble
Complex dtype with native long double components.
double float64
Native double dtype.
float float32
Native float dtype.
std::complex< double > complex128
Complex dtype with native double components.
std::int8_t int8
Signed 8-bit integer dtype.
std::int16_t int16
Signed 16-bit integer dtype.
long double longdouble
Native long double dtype; precision is platform-dependent.
std::uint64_t uint64
Unsigned 64-bit integer dtype.
std::int64_t int64
Signed 64-bit integer dtype.
std::complex< float > complex64
Complex dtype with native float components.
std::uint32_t uint32
Unsigned 32-bit integer dtype.
Maps a complex dtype to its underlying real component dtype.
Maps a real floating-point dtype to its corresponding complex dtype.
Provides compile-time metadata for a supported Stratax dtype.
Implementation registry for supported Stratax dtypes.