-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathaura.cpp
More file actions
34 lines (27 loc) · 1.05 KB
/
aura.cpp
File metadata and controls
34 lines (27 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <boost/aura/bounds.hpp>
#include <boost/aura/device.hpp>
#include <boost/aura/environment.hpp>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
PYBIND11_PLUGIN(aura)
{
using namespace boost::aura;
py::module m("aura", "aura python wrapper");
m.def("initialize", &boost::aura::initialize,
"Function that initializes aura.");
m.def("finalize", &boost::aura::finalize,
"Function that finalizes aura.");
py::class_<device>(m, "device")
.def(py::init<std::size_t>())
.def("get_ordinal", &device::get_ordinal)
.def("activate", &device::activate)
.def("deactivate", &device::deactivate);
py::class_<bounds>(m, "bounds")
.def(py::init<std::vector<int>>())
.def("size", &bounds::size)
.def("capacity", &bounds::capacity)
.def("clear", &bounds::clear)
.def("debug__", &bounds::debug__);
return m.ptr();
}