MCPcopy Create free account
hub / github.com/apache/tvm-ffi / Any_AnyView_GetInt

Function Any_AnyView_GetInt

examples/abi_overview/example_code.c:89–97  ·  view source on GitHub ↗

[Any_AnyView.GetInt_Float.begin]

Source from the content-addressed store, hash-verified

87
88// [Any_AnyView.GetInt_Float.begin]
89int64_t Any_AnyView_GetInt(const TVMFFIAny* any) {
90 if (any->type_index == kTVMFFIInt || any->type_index == kTVMFFIBool) {
91 return any->v_int64;
92 } else if (any->type_index == kTVMFFIFloat) {
93 return (int64_t)(any->v_float64);
94 }
95 assert(0); // FAILED to read int
96 return 0;
97}
98
99double Any_AnyView_GetFloat(const TVMFFIAny* any) {
100 if (any->type_index == kTVMFFIInt || any->type_index == kTVMFFIBool) {

Callers 1

CallFunctionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected