Created
October 20, 2020 03:34
-
-
Save sandeepkumar-skb/c89e30ac9ee7e1795150796afc3ccc41 to your computer and use it in GitHub Desktop.
PYBIND11 example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pybind11/pybind11.h> | |
int add(int i, int j){ | |
return i+j; | |
} | |
PYBIND11_MODULE(pybind11_example, m) { | |
m.doc() = "pybind11 example to add 2 integers"; | |
m.def("add", &add, "A function to add 2 integers"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
compile: