| 30 | inline namespace MIGRAPHX_INLINE_NS { |
| 31 | |
| 32 | static std::vector<fs::path> find_available_python_versions() |
| 33 | { |
| 34 | std::vector<fs::path> result; |
| 35 | auto path = dynamic_loader::path(&load_py).parent_path(); |
| 36 | for(const auto& entry : fs::directory_iterator{path}) |
| 37 | { |
| 38 | auto p = entry.path(); |
| 39 | if(not fs::is_regular_file(p)) |
| 40 | continue; |
| 41 | if(not contains(p.stem().string(), "migraphx_py_")) |
| 42 | continue; |
| 43 | result.push_back(p); |
| 44 | } |
| 45 | std::sort(result.begin(), result.end(), std::greater<>{}); |
| 46 | return result; |
| 47 | } |
| 48 | |
| 49 | static dynamic_loader load_py_lib() |
| 50 | { |