Skip to content

Commit

Permalink
Add python bindings for GFD mining
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonChern committed Nov 27, 2024
1 parent a7c0827 commit 6837999
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/python_bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "dynamic/bind_dynamic_fd_verification.h"
#include "fd/bind_fd.h"
#include "fd/bind_fd_verification.h"
#include "gfd/bind_gfd_mining.h"
#include "gfd/bind_gfd_verification.h"
#include "ind/bind_ind.h"
#include "md/bind_md.h"
Expand Down Expand Up @@ -58,7 +59,8 @@ PYBIND11_MODULE(desbordante, module, pybind11::mod_gil_not_used()) {
BindDynamicFdVerification,
BindNdVerification,
BindSFD,
BindMd}) {
BindMd,
BindGfdMining}) {
bind_func(module);
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/python_bindings/gfd/bind_gfd_mining.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "gfd/bind_gfd_mining.h"

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "algorithms/gfd/gfd_miner.h"
#include "py_util/bind_primitive.h"

namespace python_bindings {
void BindGfdMining(pybind11::module_& main_module) {
using namespace algos;

auto gfd_module = main_module.def_submodule("gfd_mining");

BindPrimitiveNoBase<GfdMiner>(gfd_module, "GfdMiner").def("get_gfds", &GfdMiner::GfdList);
}
} // namespace python_bindings
7 changes: 7 additions & 0 deletions src/python_bindings/gfd/bind_gfd_mining.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include <pybind11/pybind11.h>

namespace python_bindings {
void BindGfdMining(pybind11::module_& main_module);
} // namespace python_bindings

0 comments on commit 6837999

Please sign in to comment.