--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __LOCO_IR_DATA_TYPE_TRAITS_H__
+#define __LOCO_IR_DATA_TYPE_TRAITS_H__
+
+#include "loco/IR/DataType.h"
+
+namespace loco
+{
+
+/**
+ * @brief C++ scalar type corresponding to each DataType
+ */
+template <DataType DT> struct DataTypeImpl
+{
+ // using Type = ...
+};
+
+// TODO Support other enum values
+template <> struct DataTypeImpl<DataType::FLOAT32>
+{
+ // Use C++ float type for IEEE 32-bit floating-point numbers
+ using Type = float;
+};
+
+} // namespace loco
+
+#endif // __LOCO_IR_DATA_TYPE_TRAITS_H__
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "loco/IR/DataTypeTraits.h"
+
+#include <typeindex>
+
+#include <gtest/gtest.h>
+
+TEST(DataTypeTraitsTest, FLOAT32)
+{
+ auto obtained = std::type_index(typeid(loco::DataTypeImpl<loco::DataType::FLOAT32>::Type));
+ auto expected = std::type_index(typeid(float));
+
+ ASSERT_EQ(obtained, expected);
+}