diff --git a/include/aidge/data/Data.hpp b/include/aidge/data/Data.hpp index d641df6e688e738efaf49e5ae0c44649f465b644..35df9c0e0bf24ee175fe27eb7c831fcae7a700e7 100644 --- a/include/aidge/data/Data.hpp +++ b/include/aidge/data/Data.hpp @@ -125,54 +125,6 @@ private: namespace { -// Define a distinct type alias for Int4 -struct Int4Type { - std::int8_t value; -}; -struct UInt4Type { - std::uint8_t value; -}; -struct Int3Type { - std::int8_t value; -}; -struct UInt3Type { - std::uint8_t value; -}; -struct Int2Type { - std::int8_t value; -}; -struct UInt2Type { - std::uint8_t value; -}; -struct Dual_Int4Type { - std::int8_t value; -}; -struct Dual_UInt4Type { - std::uint8_t value; -}; -struct Dual_Int3Type { - std::int8_t value; -}; -struct Dual_UInt3Type { - std::uint8_t value; -}; -struct Quad_Int2Type { - std::int8_t value; -}; -struct Quad_UInt2Type { - std::uint8_t value; -}; -struct BinaryType { - std::int8_t value; -}; -struct Octo_BinaryType { - std::uint8_t value; -}; - - -// template <Aidge::DataType D> struct AidgeNbBits { static const int nbBits; }; -// template <> const int AidgeNbBits<Aidge::DataType::Int4>::nbBits = 4; - template <Aidge::DataType D> struct WeightInterleavingType { static const Aidge::DataType type; }; template <> const Aidge::DataType WeightInterleavingType<Aidge::DataType::Int4>::type = Aidge::DataType::Dual_Int4; template <> const Aidge::DataType WeightInterleavingType<Aidge::DataType::UInt4>::type = Aidge::DataType::Dual_UInt4; @@ -187,18 +139,6 @@ template <typename T> struct NativeType { static const Aidge::DataType type; }; template <> const Aidge::DataType NativeType<double>::type = Aidge::DataType::Float64; template <> const Aidge::DataType NativeType<float>::type = Aidge::DataType::Float32; template <> const Aidge::DataType NativeType<half_float::half>::type = Aidge::DataType::Float16; -template <> const Aidge::DataType NativeType<Int4Type>::type = Aidge::DataType::Int4; -template <> const Aidge::DataType NativeType<UInt4Type>::type = Aidge::DataType::UInt4; -template <> const Aidge::DataType NativeType<Int3Type>::type = Aidge::DataType::Int3; -template <> const Aidge::DataType NativeType<UInt3Type>::type = Aidge::DataType::UInt3; -template <> const Aidge::DataType NativeType<Int2Type>::type = Aidge::DataType::Int2; -template <> const Aidge::DataType NativeType<UInt2Type>::type = Aidge::DataType::UInt2; -template <> const Aidge::DataType NativeType<Dual_Int4Type>::type = Aidge::DataType::Dual_Int4; -template <> const Aidge::DataType NativeType<Dual_UInt4Type>::type = Aidge::DataType::Dual_UInt4; -template <> const Aidge::DataType NativeType<Dual_Int3Type>::type = Aidge::DataType::Dual_Int3; -template <> const Aidge::DataType NativeType<Dual_UInt3Type>::type = Aidge::DataType::Dual_UInt3; -template <> const Aidge::DataType NativeType<Quad_Int2Type>::type = Aidge::DataType::Quad_Int2; -template <> const Aidge::DataType NativeType<Quad_UInt2Type>::type = Aidge::DataType::Quad_UInt2; template <> const Aidge::DataType NativeType<std::int8_t>::type = Aidge::DataType::Int8; template <> const Aidge::DataType NativeType<std::int16_t>::type = Aidge::DataType::Int16; template <> const Aidge::DataType NativeType<std::int32_t>::type = Aidge::DataType::Int32; @@ -225,20 +165,20 @@ template <Aidge::DataType D> struct cpptype { template <> struct cpptype<Aidge::DataType::Float16> { using type = half_float::half; }; template <> struct cpptype<Aidge::DataType::Float32> { using type = float; }; template <> struct cpptype<Aidge::DataType::Float64> { using type = double; }; -template <> struct cpptype<Aidge::DataType::Int4> { using type = Int4Type; }; -template <> struct cpptype<Aidge::DataType::UInt4> { using type = UInt4Type; }; -template <> struct cpptype<Aidge::DataType::Int3> { using type = Int3Type; }; -template <> struct cpptype<Aidge::DataType::UInt3> { using type = UInt3Type; }; -template <> struct cpptype<Aidge::DataType::Int2> { using type = Int2Type; }; -template <> struct cpptype<Aidge::DataType::UInt2> { using type = UInt2Type; }; -template <> struct cpptype<Aidge::DataType::Dual_Int4> { using type = Dual_Int4Type; }; -template <> struct cpptype<Aidge::DataType::Dual_UInt4> { using type = Dual_UInt4Type; }; -template <> struct cpptype<Aidge::DataType::Dual_Int3> { using type = Dual_Int3Type; }; -template <> struct cpptype<Aidge::DataType::Dual_UInt3> { using type = Dual_UInt3Type; }; -template <> struct cpptype<Aidge::DataType::Quad_Int2> { using type = Quad_Int2Type; }; -template <> struct cpptype<Aidge::DataType::Quad_UInt2> { using type = Quad_UInt2Type; }; -template <> struct cpptype<Aidge::DataType::Binary> { using type = BinaryType; }; -template <> struct cpptype<Aidge::DataType::Octo_Binary> { using type = Octo_BinaryType; }; +template <> struct cpptype<Aidge::DataType::Int4> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::UInt4> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Int3> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::UInt3> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Int2> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::UInt2> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Dual_Int4> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Dual_UInt4> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Dual_Int3> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Dual_UInt3> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Quad_Int2> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Quad_UInt2> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Binary> { using type = std::int8_t; }; +template <> struct cpptype<Aidge::DataType::Octo_Binary> { using type = std::int8_t; }; template <> struct cpptype<Aidge::DataType::Int8> { using type = std::int8_t; }; template <> struct cpptype<Aidge::DataType::Int16> { using type = std::int16_t; }; template <> struct cpptype<Aidge::DataType::Int32> { using type = std::int32_t; };