Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
9445e1ae
Commit
9445e1ae
authored
Sep 05, 2018
by
Minjie Wang
Browse files
simple ffi example works
parent
2694b127
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
src/graph/graph.cc
src/graph/graph.cc
+19
-0
No files found.
src/graph/graph.cc
View file @
9445e1ae
#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
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment