Commit 9445e1ae authored by Minjie Wang's avatar Minjie Wang
Browse files

simple ffi example works

parent 2694b127
#include <dgl/runtime/packed_func.h>
#include <dgl/runtime/registry.h>
using namespace tvm;
using namespace tvm::runtime;
void MyAdd(TVMArgs args, TVMRetValue* rv) {
int a = args[0];
int b = args[1];
*rv = a + b;
}
void CallPacked() {
PackedFunc myadd = PackedFunc(MyAdd);
int c = myadd(1, 2);
}
TVM_REGISTER_GLOBAL("myadd")
.set_body(MyAdd);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment