9 #ifndef TREELITE_COMPILER_NATIVE_TYPEINFO_CTYPES_H_ 10 #define TREELITE_COMPILER_NATIVE_TYPEINFO_CTYPES_H_ 26 case TypeInfo::kInvalid:
27 throw std::runtime_error(
"Invalid type");
29 case TypeInfo::kUInt32:
31 case TypeInfo::kFloat32:
33 case TypeInfo::kFloat64:
36 throw std::runtime_error(std::string(
"Unrecognized type: ")
37 + std::to_string(static_cast<int>(type)));
49 case TypeInfo::kInvalid:
50 case TypeInfo::kUInt32:
51 throw std::runtime_error(std::string(
"Invalid type: ") +
TypeInfoToString(type));
53 case TypeInfo::kFloat32:
55 case TypeInfo::kFloat64:
58 throw std::runtime_error(std::string(
"Unrecognized type: ")
59 + std::to_string(static_cast<int>(type)));
71 case TypeInfo::kInvalid:
72 case TypeInfo::kUInt32:
73 throw std::runtime_error(std::string(
"Invalid type: ") +
TypeInfoToString(type));
75 case TypeInfo::kFloat32:
77 case TypeInfo::kFloat64:
80 throw std::runtime_error(std::string(
"Unrecognized type: ")
81 + std::to_string(static_cast<int>(type)));
93 case TypeInfo::kInvalid:
94 case TypeInfo::kUInt32:
95 throw std::runtime_error(std::string(
"Invalid type: ") +
TypeInfoToString(type));
97 case TypeInfo::kFloat32:
99 case TypeInfo::kFloat64:
102 throw std::runtime_error(std::string(
"Unrecognized type: ")
103 + std::to_string(static_cast<int>(type)));
115 case TypeInfo::kInvalid:
116 case TypeInfo::kUInt32:
117 throw std::runtime_error(std::string(
"Invalid type: ") +
TypeInfoToString(type));
119 case TypeInfo::kFloat32:
121 case TypeInfo::kFloat64:
124 throw std::runtime_error(std::string(
"Unrecognized type: ")
125 + std::to_string(static_cast<int>(type)));
133 #endif // TREELITE_COMPILER_NATIVE_TYPEINFO_CTYPES_H_ std::string CCopySignForTypeInfo(TypeInfo type)
Look up the correct variant of copysign() in C that should be used with a given type.
std::string CExp2ForTypeInfo(TypeInfo type)
Look up the correct variant of exp2() in C that should be used with a given type. ...
TypeInfo
Types used by thresholds and leaf outputs.
std::string TypeInfoToString(treelite::TypeInfo type)
Get string representation of type info.
std::string CExpForTypeInfo(TypeInfo type)
Look up the correct variant of exp() in C that should be used with a given type.
defines configuration macros of Treelite
std::string TypeInfoToCTypeString(TypeInfo type)
Get string representation of the C type that's equivalent to the given type info. ...
std::string CLog1PForTypeInfo(TypeInfo type)
Look up the correct variant of log1p() in C that should be used with a given type.