/gem5/ext/pybind11/tests/ |
H A D | test_pickling.cpp | 51 new (&p) Pickleable(t[0].cast<std::string>()); 54 p.setExtra1(t[1].cast<int>()); 55 p.setExtra2(t[2].cast<int>()); 67 auto p = PickleableNew(t[0].cast<std::string>()); 69 p.setExtra1(t[1].cast<int>()); 70 p.setExtra2(t[2].cast<int>()); 102 auto& p = self.cast<PickleableWithDict&>(); 103 new (&p) PickleableWithDict(t[0].cast<std::string>()); 106 p.extra = t[1].cast<int>(); 122 auto cpp_state = PickleableWithDictNew(t[0].cast<st [all...] |
H A D | test_copy_move.cpp | 75 bool load(handle src, bool) { value = MoveOnlyInt(src.cast<int>()); return true; } 76 static handle cast(const MoveOnlyInt &m, return_value_policy r, handle p) { return pybind11::cast(m.value, r, p); } function in struct:type_caster 81 bool load(handle src, bool) { value = MoveOrCopyInt(src.cast<int>()); return true; } 82 static handle cast(const MoveOrCopyInt &m, return_value_policy r, handle p) { return pybind11::cast(m.value, r, p); } function in struct:type_caster 90 bool load(handle src, bool) { value = CopyOnlyInt(src.cast<int>()); return true; } 91 static handle cast(const CopyOnlyInt &m, return_value_policy r, handle p) { return pybind11::cast(m.value, r, p); } function in struct:type_caster 92 static handle cast(cons function in struct:type_caster [all...] |
H A D | test_eval.cpp | 40 auto x = local["x"].cast<int>(); 49 return x.cast<int>() == 42; 59 auto x = local["x"].cast<int>();
|
H A D | pybind11_tests.h | 53 /// Custom cast-only type that casts to a string "rvalue" or "lvalue" depending on the cast context. 61 static handle cast(RValueCaster &&, return_value_policy, handle) { return py::str("rvalue").release(); } function in class:type_caster 62 static handle cast(const RValueCaster &, return_value_policy, handle) { return py::str("lvalue").release(); } function in class:type_caster
|
H A D | test_pytypes.cpp | 215 // When converting between Python types, obj.cast<T>() should be the same as T(obj) 217 "str"_a=d["str"].cast<py::str>(), 218 "bool"_a=d["bool"].cast<py::bool_>(), 219 "int"_a=d["int"].cast<py::int_>(), 220 "float"_a=d["float"].cast<py::float_>(), 221 "tuple"_a=d["tuple"].cast<py::tuple>(), 222 "list"_a=d["list"].cast<py::list>(), 223 "dict"_a=d["dict"].cast<py::dict>(), 224 "set"_a=d["set"].cast<py::set>(), 225 "memoryview"_a=d["memoryview"].cast<p [all...] |
H A D | test_builtin_casters.cpp | 51 m.attr("wchar_size") = py::cast(sizeof(wchar_t)); 128 // Not currently supported (std::pair caster has return-by-value cast operator); 136 l.append(py::cast(f, copy ? py::return_value_policy::copy 164 /// test void* cast operator 167 py::object o = py::cast(v); 168 return py::cast<void *>(o) == v;
|
H A D | test_methods_and_attributes.cpp | 124 static handle cast(const ArgInspector1 &src, return_value_policy, handle) { function in struct:pybind11::detail::type_caster 139 static handle cast(const ArgInspector2 &src, return_value_policy, handle) { function in struct:pybind11::detail::type_caster 151 static handle cast(const ArgAlwaysConverts &, return_value_policy, handle) { function in struct:pybind11::detail::type_caster 172 static handle cast(const DestructionTester &, return_value_policy, handle) { function in struct:pybind11::detail::type_caster
|
/gem5/ext/pybind11/tests/test_embed/ |
H A D | test_interpreter.cpp | 50 d["missing"].cast<py::object>(); 62 REQUIRE(locals["message"].cast<std::string>() == "Hello, World! - 5"); 66 REQUIRE(message.cast<std::string>() == "The question"); 68 const auto &cpp_widget = py_widget.cast<const Widget &>(); 110 REQUIRE(py::module::import("widget_module").attr("add")(1, 2).cast<int>() == 3); 113 REQUIRE(py::module::import("external_module").attr("A")(123).attr("value").cast<int>() == 123); 117 py::module::import("external_module").attr("internals_at")().cast<uintptr_t>()); 133 py::module::import("external_module").attr("internals_at")().cast<uintptr_t>()); 153 REQUIRE(cpp_module.attr("add")(1, 2).cast<int>() == 3); 158 REQUIRE(py_widget.attr("the_message").cast<st [all...] |
/gem5/src/python/ |
H A D | marshal.cc | 65 auto marshalled = locals["marshalled"].cast<std::string>();
|
/gem5/ext/pybind11/tests/test_cmake_build/ |
H A D | embed.cpp | 16 if (m.attr("add")(1, 2).cast<int>() != 3)
|
/gem5/src/python/pybind11/ |
H A D | core.cc | 82 return f(name).cast<SimObject *>(); 258 m_core.attr("compileDate") = py::cast(compileDate); 260 m_core.attr("flag_DEBUG") = py::cast(flag_DEBUG); 261 m_core.attr("flag_DEBUG") = py::cast(flag_DEBUG); 262 m_core.attr("flag_NDEBUG") = py::cast(flag_NDEBUG); 263 m_core.attr("flag_TRACING_ON") = py::cast(flag_TRACING_ON); 265 m_core.attr("MaxTick") = py::cast(MaxTick);
|
H A D | event.cc | 84 py::object obj = py::cast(this); 94 py::object obj = py::cast(this); 173 #define PRIO(n) c_event.attr(# n) = py::cast((int)Event::n)
|
/gem5/ext/pybind11/include/pybind11/ |
H A D | cast.h | 2 pybind11/cast.h: Partial template specializations to cast between 63 /// at argument preparation time or by `py::cast()` at execution time. 67 throw cast_error("When called outside a bound function, py::cast() cannot " 416 errorString += handle(scope.type).attr("__name__").cast<std::string>(); 442 " " + handle(frame->f_code->co_filename).cast<std::string>() + 444 handle(frame->f_code->co_name).cast<std::string>() + "\n"; 495 PYBIND11_NOINLINE static handle cast(const void *_src, return_value_policy policy, handle parent, function in class:type_caster_generic 589 for (auto &cast : typeinfo->implicit_casts) { 590 type_caster_generic sub_caster(*cast 835 static handle cast(const itype &src, return_value_policy policy, handle parent) { function in class:type_caster_base 841 static handle cast(itype &&src, return_value_policy, handle parent) { function in class:type_caster_base 869 static handle cast(const itype *src, return_value_policy policy, handle parent) { function in class:type_caster_base [all...] |
H A D | stl.h | 86 static handle cast(T &&src, return_value_policy policy, handle parent) { function in struct:set_caster 91 auto value_ = reinterpret_steal<object>(key_conv::cast(forward_like<T>(value), policy, parent)); 122 static handle cast(T &&src, return_value_policy policy, handle parent) { function in struct:map_caster 131 auto key = reinterpret_steal<object>(key_conv::cast(forward_like<T>(kv.first), policy_key, parent)); 132 auto value = reinterpret_steal<object>(value_conv::cast(forward_like<T>(kv.second), policy_value, parent)); 169 static handle cast(T &&src, return_value_policy policy, handle parent) { function in struct:list_caster 175 auto value_ = reinterpret_steal<object>(value_conv::cast(forward_like<T>(value), policy, parent)); 228 static handle cast(T &&src, return_value_policy policy, handle parent) { function in struct:array_caster 232 auto value_ = reinterpret_steal<object>(value_conv::cast(forward_like<T>(value), policy, parent)); 266 static handle cast(T function in struct:optional_caster 361 static handle cast(Variant &&src, return_value_policy policy, handle parent) { function in struct:variant_caster [all...] |
H A D | functional.h | 76 return (retval.template cast<Return>()); 85 static handle cast(Func &&f_, return_value_policy policy, handle /* parent */) { function in struct:type_caster
|
H A D | eigen.h | 317 static handle cast(Type &&src, return_value_policy /* policy */, handle parent) { function in struct:type_caster 321 static handle cast(const Type &&src, return_value_policy /* policy */, handle parent) { function in struct:type_caster 325 static handle cast(Type &src, return_value_policy policy, handle parent) { function in struct:type_caster 331 static handle cast(const Type &src, return_value_policy policy, handle parent) { function in struct:type_caster 334 return cast(&src, policy, parent); 337 static handle cast(Type *src, return_value_policy policy, handle parent) { function in struct:type_caster 341 static handle cast(const Type *src, return_value_policy policy, handle parent) { function in struct:type_caster 369 static handle cast(const MapType &src, return_value_policy policy, handle parent) { function in struct:eigen_map_caster 516 // load() is not supported, but we can cast them into the python domain by first copying to a 524 static handle cast(cons function in struct:type_caster 528 static handle cast(const Type *src, return_value_policy policy, handle parent) { return cast(*src, policy, parent); } function in struct:type_caster 580 static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) { function in struct:type_caster [all...] |
H A D | complex.h | 58 static handle cast(const std::complex<T> &src, return_value_policy /* policy */, handle /* parent */) { function in class:type_caster
|
H A D | embed.h | 109 module::import("sys").attr("path").cast<list>().append(".");
|
H A D | chrono.h | 73 static handle cast(const type &src, return_value_policy /* policy */, handle /* parent */) { function in class:duration_caster 147 static handle cast(const std::chrono::time_point<std::chrono::system_clock, Duration> &src, return_value_policy /* policy */, handle /* parent */) { function in class:type_caster
|
/gem5/src/cpu/testers/traffic_gen/ |
H A D | pygen.cc | 74 metaGenerator->cast<std::shared_ptr<BaseGen>>();
|
/gem5/src/systemc/core/ |
H A D | sc_main_python.cc | 63 std::string arg = args[idx].cast<std::string>();
|
/gem5/ext/systemc/src/sysc/datatypes/fx/ |
H A D | sc_fxnum.h | 580 void cast(); 1007 void cast(); 2571 sc_fxnum::cast() function in class:sc_dt::sc_fxnum 2576 m_rep->cast( m_params, m_q_flag, m_o_flag ); 2611 cast(); \ 2702 c.cast(); 2877 c.cast(); \ 2889 c.cast(); \ 2923 c.cast(); \ 2950 c.cast(); \ [all...] |
/gem5/src/systemc/ext/dt/fx/ |
H A D | sc_fxnum.hh | 498 void cast(); 859 void cast(); 2176 sc_fxnum::cast() function in class:sc_dt::sc_fxnum 2181 m_rep->cast(m_params, m_q_flag, m_o_flag); 2203 cast(); \ 2282 c.cast(); 2438 c.cast(); \ 2449 c.cast(); \ 2477 c.cast(); \ 2501 c.cast(); \ [all...] |
/gem5/configs/example/ |
H A D | read_config.py | 77 def simple_parser(suffix='', cast=lambda i: i): 79 return cls(cast(param + suffix)) 82 # def tick_parser(cast=m5.objects.Latency): # lambda i: i): 83 def tick_parser(cast=lambda i: i): 86 ret = cls(cast(str(param) + 't')) 117 'NumericParamValue': simple_parser(cast=long), 119 'Frequency': tick_parser(cast=m5.objects.Latency),
|
/gem5/ext/pybind11/include/pybind11/detail/ |
H A D | class.h | 101 return (PyTypeObject *) d["pybind11_static_property"].cast<object>().release().ptr(); 248 /// holding C++ objects and holders. Allocation is done lazily (the first time the instance is cast 282 msg += handle((PyObject *) type).attr("__module__").cast<std::string>() + "."; 526 qualname = str(rec.scope.attr("__qualname__").cast<std::string>() + "." + rec.name); 540 module ? str(module).cast<std::string>() + "." + rec.name :
|