/gem5/src/systemc/core/ |
H A D | sc_time_python.cc | 46 .def(pybind11::init<>()) 47 .def(pybind11::init<double, sc_core::sc_time_unit>()) 48 .def(pybind11::init<const sc_core::sc_time &>()) 51 .def("value", &sc_core::sc_time::value) 52 .def("to_double", &sc_core::sc_time::to_double) 53 .def("to_seconds", &sc_core::sc_time::to_seconds) 54 .def("to_string", &sc_core::sc_time::to_string) 55 .def("__str__", &sc_core::sc_time::to_string) 58 .def(pybind11::self == pybind11::self) 59 .def(pybind1 [all...] |
/gem5/src/python/pybind11/ |
H A D | debug.cc | 87 .def("getAllFlagsVersion", []() { return Debug::allFlagsVersion; }) 88 .def("allFlags", &Debug::allFlags, py::return_value_policy::reference) 89 .def("findFlag", &Debug::findFlag) 90 .def("setDebugFlag", &setDebugFlag) 91 .def("clearDebugFlag", &clearDebugFlag) 92 .def("dumpDebugFlags", &dumpDebugFlags) 94 .def("schedBreak", &schedBreak) 95 .def("setRemoteGDBPort", &setRemoteGDBPort) 100 .def("name", &Debug::Flag::name) 101 .def("des [all...] |
H A D | stats.cc | 84 .def("initSimStats", &Stats::initSimStats) 85 .def("initText", &Stats::initText, py::return_value_policy::reference) 87 .def("initHDF5", &Stats::initHDF5) 89 .def("registerPythonStatsHandlers", 91 .def("schedStatEvent", &Stats::schedStatEvent) 92 .def("periodicStatDump", &Stats::periodicStatDump) 93 .def("updateEvents", &Stats::updateEvents) 94 .def("processResetQueue", &Stats::processResetQueue) 95 .def("processDumpQueue", &Stats::processDumpQueue) 96 .def("enabl [all...] |
H A D | core.cc | 112 .def("drainState", &Drainable::drainState) 113 .def("notifyFork", &Drainable::notifyFork) 120 .def("tryDrain", &DrainManager::tryDrain) 121 .def("resume", &DrainManager::resume) 122 .def("preCheckpointRestore", &DrainManager::preCheckpointRestore) 123 .def("isDrained", &DrainManager::isDrained) 124 .def("state", &DrainManager::state) 125 .def("signalDrainDone", &DrainManager::signalDrainDone) 150 .def(py::init<>()) 151 .def(p [all...] |
H A D | event.cc | 109 m.def("simulate", &simulate, 111 m.def("exitSimLoop", &exitSimLoop); 112 m.def("getEventQueue", []() { return curEventQueue(); }, 114 m.def("setEventQueue", [](EventQueue *q) { return curEventQueue(q); }); 115 m.def("getEventQueue", &getEventQueue, 119 .def("name", [](EventQueue *eq) { return eq->name(); }) 120 .def("dump", &EventQueue::dump) 121 .def("schedule", [](EventQueue *eq, PyEvent *e, Tick t) { 124 .def("deschedule", &EventQueue::deschedule, 126 .def("reschedul [all...] |
/gem5/ext/pybind11/tests/ |
H A D | test_builtin_casters.cpp | 20 m.def("string_roundtrip", [](const char *s) { return s; }); 33 m.def("good_utf8_string", []() { return std::string(u8"Say utf8\u203d \U0001f382 \U0001d400"); }); // Say utf8‽ 🎂 𝐀 34 m.def("good_utf16_string", [=]() { return std::u16string({ b16, ib16, cake16_1, cake16_2, mathbfA16_1, mathbfA16_2, z16 }); }); // b‽🎂𝐀z 35 m.def("good_utf32_string", [=]() { return std::u32string({ a32, mathbfA32, cake32, ib32, z32 }); }); // a𝐀🎂‽z 36 m.def("good_wchar_string", [=]() { return wstr; }); // a‽𝐀z 37 m.def("bad_utf8_string", []() { return std::string("abc\xd0" "def"); }); 38 m.def("bad_utf16_string", [=]() { return std::u16string({ b16, char16_t(0xd800), z16 }); }); 41 m.def("bad_utf32_string", [=]() { return std::u32string({ a32, char32_t(0xd800), z32 }); }); 43 m.def("bad_wchar_strin [all...] |
H A D | test_docstring_options.cpp | 18 m.def("test_function1", [](int, int) {}, py::arg("a"), py::arg("b")); 19 m.def("test_function2", [](int, int) {}, py::arg("a"), py::arg("b"), "A custom docstring"); 21 m.def("test_overloaded1", [](int) {}, py::arg("i"), "Overload docstring"); 22 m.def("test_overloaded1", [](double) {}, py::arg("d")); 24 m.def("test_overloaded2", [](int) {}, py::arg("i"), "overload docstring 1"); 25 m.def("test_overloaded2", [](double) {}, py::arg("d"), "overload docstring 2"); 27 m.def("test_overloaded3", [](int) {}, py::arg("i")); 28 m.def("test_overloaded3", [](double) {}, py::arg("d"), "Overload docstr"); 32 m.def("test_function3", [](int, int) {}, py::arg("a"), py::arg("b")); 33 m.def("test_function [all...] |
H A D | test_opaque_types.cpp | 26 .def(py::init<>()) 27 .def("pop_back", &StringList::pop_back) 29 .def("push_back", (void (StringList::*)(const std::string &)) &StringList::push_back) 30 .def("back", (std::string &(StringList::*)()) &StringList::back) 31 .def("__len__", [](const StringList &v) { return v.size(); }) 32 .def("__iter__", [](StringList &v) { 41 .def(py::init<>()) 44 m.def("print_opaque_list", [](const StringList &l) { 57 m.def("return_void_ptr", []() { return (void *) 0x1234; }); 58 m.def("get_void_ptr_valu [all...] |
H A D | test_gil_scoped.cpp | 32 .def(py::init<>()) 33 .def("virtual_func", &VirtClass::virtual_func) 34 .def("pure_virtual_func", &VirtClass::pure_virtual_func); 36 m.def("test_callback_py_obj", 38 m.def("test_callback_std_func", 40 m.def("test_callback_virtual_func", 42 m.def("test_callback_pure_virtual_func", 44 m.def("test_cross_module_gil",
|
H A D | test_local_bindings.cpp | 19 m.def("load_external1", [](ExternalType1 &e) { return e.i; }); 20 m.def("load_external2", [](ExternalType2 &e) { return e.i; }); 25 .def("get3", [](LocalType &t) { return t.i + 3; }) 28 m.def("local_value", [](LocalType &l) { return l.i; }); 34 .def(py::init<int>()) 35 .def("get", [](LocalType &i) { return i.i; }) 43 m.def("register_local_external", [m]() { 68 m.def("register_mixed_global", [m]() { 71 m.def("register_mixed_local", [m]() { 74 m.def("get_mixed_g [all...] |
H A D | pybind11_cross_module_tests.cpp | 28 m.def("raise_runtime_error", []() { PyErr_SetString(PyExc_RuntimeError, "My runtime error"); throw py::error_already_set(); }); 29 m.def("raise_value_error", []() { PyErr_SetString(PyExc_ValueError, "My value error"); throw py::error_already_set(); }); 30 m.def("throw_pybind_value_error", []() { throw py::value_error("pybind11 value error"); }); 31 m.def("throw_pybind_type_error", []() { throw py::type_error("pybind11 type error"); }); 32 m.def("throw_stop_iteration", []() { throw py::stop_iteration(); }); 37 .def("get2", [](LocalType &t) { return t.i + 2; }) 41 m.def("local_value", [](LocalType &l) { return l.i; }); 46 m.def("register_nonlocal", [m]() { 58 m.def("register_nonlocal_vec", [m]() { 61 m.def("register_nonlocal_ma [all...] |
H A D | test_stl.cpp | 55 m.def("cast_vector", []() { return std::vector<int>{1}; }); 56 m.def("load_vector", [](const std::vector<int> &v) { return v.at(0) == 1 && v.at(1) == 2; }); 58 m.def("cast_bool_vector", []() { return std::vector<bool>{true, false}; }); 59 m.def("load_bool_vector", [](const std::vector<bool> &v) { 64 m.def("cast_ptr_vector", []() { return &lvv; }); 67 m.def("cast_deque", []() { return std::deque<int>{1}; }); 68 m.def("load_deque", [](const std::deque<int> &v) { return v.at(0) == 1 && v.at(1) == 2; }); 71 m.def("cast_array", []() { return std::array<int, 2> {{1 , 2}}; }); 72 m.def("load_array", [](const std::array<int, 2> &a) { return a[0] == 1 && a[1] == 2; }); 75 m.def("cast_valarra [all...] |
H A D | test_multiple_inheritance.cpp | 56 b1.def(py::init<int>()) 57 .def("foo", &Base1::foo); 65 b2.def(py::init<int>()) 66 .def("bar", &Base2::bar); 78 .def(py::init<int, int>()); 82 #define PYBIND11_BASEN(N) py::class_<BaseN<N>>(m, "BaseN" #N).def(py::init<int>()).def("f" #N, [](BaseN<N> &b) { return b.i + N; }) 96 // .def(py::init<int, int>()); 108 .def(py::init<int>()) 109 .def("fo [all...] |
H A D | test_constants_and_functions.cpp | 85 m.def("test_function", &test_function1); 86 m.def("test_function", &test_function2); 87 m.def("test_function", &test_function3); 90 m.def("test_function", py::overload_cast<>(&test_function4)); 91 m.def("test_function", py::overload_cast<char *>(&test_function4)); 92 m.def("test_function", py::overload_cast<int, float>(&test_function4)); 93 m.def("test_function", py::overload_cast<float, int>(&test_function4)); 95 m.def("test_function", static_cast<py::str (*)()>(&test_function4)); 96 m.def("test_function", static_cast<py::str (*)(char *)>(&test_function4)); 97 m.def("test_functio [all...] |
H A D | test_operator_overloading.cpp | 89 .def(py::init<float, float>()) 90 .def(py::self + py::self) 91 .def(py::self + float()) 92 .def(py::self - py::self) 93 .def(py::self - float()) 94 .def(py::self * float()) 95 .def(py::self / float()) 96 .def(py::self * py::self) 97 .def(py::self / py::self) 98 .def(p [all...] |
H A D | test_async.cpp | 15 .def(py::init<>()); 18 .def(py::init<>()) 19 .def("__await__", [](const SupportsAsync& self) -> py::object {
|
H A D | test_call_policies.cpp | 44 .def(py::init<>()); 55 .def(py::init<>()) 56 .def(py::init([](Child *) { return new Parent(); }), py::keep_alive<1, 2>()) 57 .def("addChild", &Parent::addChild) 58 .def("addChildKeepAlive", &Parent::addChild, py::keep_alive<1, 2>()) 59 .def("returnChild", &Parent::returnChild) 60 .def("returnChildKeepAlive", &Parent::returnChild, py::keep_alive<1, 0>()) 61 .def("returnNullChildKeepAliveChild", &Parent::returnNullChild, py::keep_alive<1, 0>()) 62 .def("returnNullChildKeepAliveParent", &Parent::returnNullChild, py::keep_alive<0, 1>()); 71 .def(p [all...] |
H A D | test_chrono.cpp | 23 m.def("test_chrono1", []() { return std::chrono::system_clock::now(); }); 27 m.def("test_chrono2", [](system_time t) { return t; }); 31 m.def("test_chrono3", [](std::chrono::system_clock::duration d) { return d; }); 35 m.def("test_chrono4", [](system_time a, system_time b) { return a - b; }); 39 m.def("test_chrono5", []() { return std::chrono::steady_clock::now(); }); 43 m.def("test_chrono6", [](steady_time t) { return t; }); 47 m.def("test_chrono7", [](std::chrono::microseconds t) { return t; }); 49 m.def("test_chrono_float_diff", [](std::chrono::duration<float> a, std::chrono::duration<float> b) { 52 m.def("test_nano_timepoint", [](timestamp start, timespan delta) -> timestamp {
|
H A D | test_methods_and_attributes.cpp | 213 emna.def(py::init<>()) 214 .def(py::init<int>()) 215 .def(py::init<const ExampleMandA&>()) 216 .def("add1", &ExampleMandA::add1) 217 .def("add2", &ExampleMandA::add2) 218 .def("add3", &ExampleMandA::add3) 219 .def("add4", &ExampleMandA::add4) 220 .def("add5", &ExampleMandA::add5) 221 .def("add6", &ExampleMandA::add6) 222 .def("add [all...] |
H A D | test_eigen.cpp | 93 m.def("double_col", [](const Eigen::VectorXf &x) -> Eigen::VectorXf { return 2.0f * x; }); 94 m.def("double_row", [](const Eigen::RowVectorXf &x) -> Eigen::RowVectorXf { return 2.0f * x; }); 95 m.def("double_complex", [](const Eigen::VectorXcf &x) -> Eigen::VectorXcf { return 2.0f * x; }); 96 m.def("double_threec", [](py::EigenDRef<Eigen::Vector3f> x) { x *= 2; }); 97 m.def("double_threer", [](py::EigenDRef<Eigen::RowVector3f> x) { x *= 2; }); 98 m.def("double_mat_cm", [](Eigen::MatrixXf x) -> Eigen::MatrixXf { return 2.0f * x; }); 99 m.def("double_mat_rm", [](DenseMatrixR x) -> DenseMatrixR { return 2.0f * x; }); 103 m.def("cholesky1", [](Eigen::Ref<MatrixXdR> x) -> Eigen::MatrixXd { return x.llt().matrixL(); }); 104 m.def("cholesky2", [](const Eigen::Ref<const MatrixXdR> &x) -> Eigen::MatrixXd { return x.llt().matrixL(); }); 105 m.def("cholesky [all...] |
H A D | test_kwargs_and_defaults.cpp | 18 m.def("kw_func0", kw_func); 19 m.def("kw_func1", kw_func, py::arg("x"), py::arg("y")); 20 m.def("kw_func2", kw_func, py::arg("x") = 100, py::arg("y") = 200); 21 m.def("kw_func3", [](const char *) { }, py::arg("data") = std::string("Hello world!")); 25 m.def("kw_func4", [](const std::vector<int> &entries) { 33 m.def("kw_func_udl", kw_func, "x"_a, "y"_a=300); 34 m.def("kw_func_udl_z", kw_func, "x"_a, "y"_a=0); 37 m.def("args_function", [](py::args args) -> py::tuple { 40 m.def("args_kwargs_function", [](py::args args, py::kwargs kwargs) { 45 m.def("mixed_plus_arg [all...] |
H A D | pybind11_tests.cpp | 47 .def("alive", &ConstructorStats::alive) 48 .def("values", &ConstructorStats::values) 77 .def(py::init<>()) 78 .def(py::init<int>()) 79 .def("get_value", &UserType::value, "Get value using a method") 80 .def("set_value", &UserType::set, "Set value using a method") 82 .def("__repr__", [](const UserType& u) { return "UserType({})"_s.format(u.value()); }); 85 .def(py::init<>()) 86 .def(py::init<int>()) 87 .def("__repr_ [all...] |
/gem5/src/systemc/tlm_core/2/quantum/ |
H A D | global_quantum_python.cc | 45 .def("set", &tlm::tlm_global_quantum::set) 46 .def("get", &tlm::tlm_global_quantum::get) 47 .def("compute_local_quantum",
|
/gem5/ext/pybind11/tests/test_cmake_build/ |
H A D | main.cpp | 5 m.def("add", [](int i, int j) { return i + j; });
|
/gem5/ext/pybind11/tests/test_embed/ |
H A D | external_module.cpp | 17 .def(py::init<int>()) 20 m.def("internals_at", []() {
|