Skip to content

Commit 9f53935

Browse files
Merge pull request #1828 from arcaneframework/dev/gg-add-explicit-values-for-arcane-edatatype
Add explicit values for 'eDataType'
2 parents 3c67eb5 + e9f081c commit 9f53935

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

arcane/src/arcane/core/datatype/DataTypes.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ enum eDataType
3838
#endif
3939
{
4040
DT_Byte = 0, //!< Donnée de type octet
41-
DT_Real, //!< Donnée de type réel
42-
DT_Int16, //!< Donnée de type entier 16 bits
43-
DT_Int32, //!< Donnée de type entier 32 bits
44-
DT_Int64, //!< Donnée de type entier 64 bits
45-
DT_String, //!< Donnée de type chaîne de caractère UTF-8
46-
DT_Real2, //!< Donnée de type vecteur 2
47-
DT_Real3, //!< Donnée de type vecteur 3
48-
DT_Real2x2, //!< Donnée de type tenseur 3x3
49-
DT_Real3x3, //!< Donnée de type tenseur 3x3
50-
DT_BFloat16, //!< Donnée de type 'BFloat16'
51-
DT_Float16, //!< Donnée de type 'Float16'
52-
DT_Float32, //!< Donnée de type 'Float32'
53-
DT_Int8, //!< Donnée de type entier sur 8 bits
54-
DT_Unknown //!< Donnée de type inconnue ou non initialisée
41+
DT_Real = 1, //!< Donnée de type réel
42+
DT_Int16 = 2, //!< Donnée de type entier 16 bits
43+
DT_Int32 = 3, //!< Donnée de type entier 32 bits
44+
DT_Int64 = 4, //!< Donnée de type entier 64 bits
45+
DT_String = 5, //!< Donnée de type chaîne de caractère UTF-8
46+
DT_Real2 = 6, //!< Donnée de type vecteur 2
47+
DT_Real3 = 7, //!< Donnée de type vecteur 3
48+
DT_Real2x2 = 8, //!< Donnée de type tenseur 3x3
49+
DT_Real3x3 = 9, //!< Donnée de type tenseur 3x3
50+
DT_BFloat16 = 10, //!< Donnée de type 'BFloat16'
51+
DT_Float16 = 11, //!< Donnée de type 'Float16'
52+
DT_Float32 = 12, //!< Donnée de type 'Float32'
53+
DT_Int8 = 13, //!< Donnée de type entier sur 8 bits
54+
DT_Unknown = 14 //!< Donnée de type inconnue ou non initialisée
5555
};
5656

5757
//! Nombre de valeurs de eDataType

arcane/src/arcane/core/tests/TestDataTypes.cc

+12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
#include "arcane/core/datatype/DataTypes.h"
1515

16+
#include "arccore/serialize/ISerializer.h"
17+
1618
/*---------------------------------------------------------------------------*/
1719
/*---------------------------------------------------------------------------*/
1820

@@ -48,6 +50,16 @@ TEST(ArcaneDataTypes, Misc)
4850

4951
EXPECT_THROW(dataTypeSize((eDataType)50), ArgumentException);
5052
ASSERT_EQ(dataTypeFromName("Toto"), DT_Unknown);
53+
54+
ASSERT_EQ((int)eDataType::DT_Byte, (int)Arccore::ISerializer::DT_Byte);
55+
ASSERT_EQ((int)eDataType::DT_Real, (int)Arccore::ISerializer::DT_Real);
56+
ASSERT_EQ((int)eDataType::DT_Int16, (int)Arccore::ISerializer::DT_Int16);
57+
ASSERT_EQ((int)eDataType::DT_Int32, (int)Arccore::ISerializer::DT_Int32);
58+
ASSERT_EQ((int)eDataType::DT_Int64, (int)Arccore::ISerializer::DT_Int64);
59+
ASSERT_EQ((int)eDataType::DT_Float32, (int)Arccore::ISerializer::DT_Float32);
60+
ASSERT_EQ((int)eDataType::DT_Float16, (int)Arccore::ISerializer::DT_Float16);
61+
ASSERT_EQ((int)eDataType::DT_BFloat16, (int)Arccore::ISerializer::DT_BFloat16);
62+
ASSERT_EQ((int)eDataType::DT_Int8, (int)Arccore::ISerializer::DT_Int8);
5163
}
5264

5365
/*---------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)