aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2022-05-25 17:52:29 +0100
committerJeremy Johnson <jeremy.johnson@arm.com>2022-05-26 08:57:22 +0100
commit4102773d83e236448130b43b1747621ace00160f (patch)
tree9793b7fefa267bed1c8b5c24ccc3182a60b64724
parent44c11203d7ab5305af8edd6d6cc5e70fd4f1fb72 (diff)
downloadserialization_lib-4102773d83e236448130b43b1747621ace00160f.tar.gz
Add support for uint16_t
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Ieab5c56db49549726dd5efb0d9b728713fc6f86a
-rw-r--r--include/tosa_generated.h13
-rw-r--r--python/serializer/tosa_serializer.py1
-rw-r--r--python/tosa/DType.py1
-rw-r--r--schema/tosa.fbs1
4 files changed, 11 insertions, 5 deletions
diff --git a/include/tosa_generated.h b/include/tosa_generated.h
index 3bc1546..c30a04d 100644
--- a/include/tosa_generated.h
+++ b/include/tosa_generated.h
@@ -96,11 +96,12 @@ enum DType : uint32_t {
DType_INT32 = 6,
DType_INT48 = 7,
DType_FLOAT = 8,
+ DType_UINT16 = 9,
DType_MIN = DType_UNKNOWN,
- DType_MAX = DType_FLOAT
+ DType_MAX = DType_UINT16
};
-inline const DType (&EnumValuesDType())[9] {
+inline const DType (&EnumValuesDType())[10] {
static const DType values[] = {
DType_UNKNOWN,
DType_BOOL,
@@ -110,13 +111,14 @@ inline const DType (&EnumValuesDType())[9] {
DType_INT16,
DType_INT32,
DType_INT48,
- DType_FLOAT
+ DType_FLOAT,
+ DType_UINT16
};
return values;
}
inline const char * const *EnumNamesDType() {
- static const char * const names[10] = {
+ static const char * const names[11] = {
"UNKNOWN",
"BOOL",
"UINT8",
@@ -126,13 +128,14 @@ inline const char * const *EnumNamesDType() {
"INT32",
"INT48",
"FLOAT",
+ "UINT16",
nullptr
};
return names;
}
inline const char *EnumNameDType(DType e) {
- if (flatbuffers::IsOutRange(e, DType_UNKNOWN, DType_FLOAT)) return "";
+ if (flatbuffers::IsOutRange(e, DType_UNKNOWN, DType_UINT16)) return "";
const size_t index = static_cast<size_t>(e);
return EnumNamesDType()[index];
}
diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py
index b29f963..660619b 100644
--- a/python/serializer/tosa_serializer.py
+++ b/python/serializer/tosa_serializer.py
@@ -53,6 +53,7 @@ DTypeNames = [
"INT32",
"INT48",
"FLOAT",
+ "UINT16",
]
ByteMask = np.uint64(0xFF)
diff --git a/python/tosa/DType.py b/python/tosa/DType.py
index 65432db..ad9048b 100644
--- a/python/tosa/DType.py
+++ b/python/tosa/DType.py
@@ -12,4 +12,5 @@ class DType(object):
INT32 = 6
INT48 = 7
FLOAT = 8
+ UINT16 = 9
diff --git a/schema/tosa.fbs b/schema/tosa.fbs
index 33075ed..4267adf 100644
--- a/schema/tosa.fbs
+++ b/schema/tosa.fbs
@@ -30,6 +30,7 @@ enum DType:uint32 {
INT32,
INT48,
FLOAT,
+ UINT16,
}
enum ResizeMode:uint32 {