Skip to content
Snippets Groups Projects
Commit 7b7f376a authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Fix the new datatypes in data.hpp

parent 037e6205
No related branches found
No related tags found
2 merge requests!318[Upd] release verision 0.5.0,!262Low bit support for ARM Cortex-M export
Pipeline #61820 passed
......@@ -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; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment