| 55 | } |
| 56 | |
| 57 | static py::dict run_file(const std::string& file) |
| 58 | { |
| 59 | py::object scope = py::module_::import("__main__").attr("__dict__"); |
| 60 | std::string buffer; |
| 61 | buffer.append("import sys\n"); |
| 62 | buffer.append("sys.path.insert(0, '" + python_path() + "')\n"); |
| 63 | buffer.append("import migraphx\n"); |
| 64 | buffer.append(read_string(file)); |
| 65 | py::exec(buffer, scope); |
| 66 | return scope.cast<py::dict>(); |
| 67 | } |
| 68 | |
| 69 | extern "C" program migraphx_load_py(const std::string& filename) |
| 70 | { |
no test coverage detected