| 790 | #endif |
| 791 | |
| 792 | void init_custom(pybind11::module m) { |
| 793 | m.def("_install", &install_custom); |
| 794 | m.def("_uninstall", &uninstall_custom); |
| 795 | m.def("_get_custom_op_list", &get_custom_op_list); |
| 796 | m.def("_get_custom_op_lib_info", &get_custom_op_lib_info); |
| 797 | m.def("get_custom_op_abi_tag", [](void) -> int { |
| 798 | int ret = 0; |
| 799 | #ifdef _GLIBCXX_USE_CXX11_ABI |
| 800 | ret = _GLIBCXX_USE_CXX11_ABI; |
| 801 | #endif |
| 802 | return ret; |
| 803 | }); |
| 804 | |
| 805 | static PyMethodDef method_def = { |
| 806 | #ifdef METH_FASTCALL |
| 807 | "_make_custom_op", (PyCFunction)make_custom_op, METH_FASTCALL, "" |
| 808 | #else |
| 809 | "_make_custom_op", (PyCFunction)py35_make_custom_op, METH_VARARGS, "" |
| 810 | #endif |
| 811 | }; |
| 812 | auto* func = PyCFunction_NewEx(&method_def, nullptr, nullptr); |
| 813 | pybind11::setattr(m, method_def.ml_name, func); |
| 814 | } |