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
5c76e47f
Unverified
Commit
5c76e47f
authored
Jul 14, 2022
by
Hongyi ZHANG
Committed by
GitHub
Jul 14, 2022
Browse files
[Docs] fix ffi docs (#4248)
Co-authored-by:
Minjie Wang
<
wmjlyjemaine@gmail.com
>
parent
20fe9397
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
docs/source/developer/ffi.rst
docs/source/developer/ffi.rst
+3
-1
No files found.
docs/source/developer/ffi.rst
View file @
5c76e47f
...
@@ -24,11 +24,13 @@ API that is exposed to python is only a few lines of codes:
...
@@ -24,11 +24,13 @@ API that is exposed to python is only a few lines of codes:
#include <dgl/runtime/packed_func.h>
#include <dgl/runtime/packed_func.h>
#include <dgl/runtime/registry.h>
#include <dgl/runtime/registry.h>
using namespace dgl::runtime;
DGL_REGISTER_GLOBAL("calculator.MyAdd")
DGL_REGISTER_GLOBAL("calculator.MyAdd")
.set_body([] (DGLArgs args, DGLRetValue* rv) {
.set_body([] (DGLArgs args, DGLRetValue* rv) {
int a = args[0];
int a = args[0];
int b = args[1];
int b = args[1];
*rv = a
*
b;
*rv = a
+
b;
});
});
Compile and build the library. On the python side, create a
Compile and build the library. On the python side, create a
...
...
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