9 #ifndef TREELITE_COMPILER_NATIVE_TYPEINFO_CTYPES_H_ 10 #define TREELITE_COMPILER_NATIVE_TYPEINFO_CTYPES_H_ 27 case TypeInfo::kInvalid:
28 throw Error(
"Invalid type");
30 case TypeInfo::kUInt32:
32 case TypeInfo::kFloat32:
34 case TypeInfo::kFloat64:
37 throw Error(std::string(
"Unrecognized type: ") + std::to_string(static_cast<int>(type)));
49 case TypeInfo::kInvalid:
50 case TypeInfo::kUInt32:
53 case TypeInfo::kFloat32:
55 case TypeInfo::kFloat64:
58 throw Error(std::string(
"Unrecognized type: ") + std::to_string(static_cast<int>(type)));
70 case TypeInfo::kInvalid:
71 case TypeInfo::kUInt32:
74 case TypeInfo::kFloat32:
76 case TypeInfo::kFloat64:
79 throw Error(std::string(
"Unrecognized type: ") + std::to_string(static_cast<int>(type)));
91 case TypeInfo::kInvalid:
92 case TypeInfo::kUInt32:
95 case TypeInfo::kFloat32:
97 case TypeInfo::kFloat64:
100 throw Error(std::string(
"Unrecognized type: ") + std::to_string(static_cast<int>(type)));
112 case TypeInfo::kInvalid:
113 case TypeInfo::kUInt32:
116 case TypeInfo::kFloat32:
118 case TypeInfo::kFloat64:
121 throw Error(std::string(
"Unrecognized type: ") + std::to_string(static_cast<int>(type)));
129 #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. ...
Exception class that will be thrown by Treelite.
Exception class used throughout the Treelite codebase.
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.