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

Function ExamplegGlobalFunctionRegistry

tests/cpp/test_example.cc:94–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void ExamplegGlobalFunctionRegistry() {
95 namespace ffi = tvm::ffi;
96 ffi::reflection::GlobalDef().def("xyz.add1", [](const int a) -> int { return a + 1; });
97 ffi::Function fadd1 = ffi::Function::GetGlobalRequired("xyz.add1");
98 int b = fadd1(1).cast<int>();
99 EXPECT_EQ(b, 2);
100}
101
102void FuncThrowError() {
103 namespace ffi = tvm::ffi;

Callers 1

TESTFunction · 0.85

Calls 1

GlobalDefClass · 0.85

Tested by

no test coverage detected