| 26 | // register as "ROCm" and get their own BackendType::Hip. The names are spelled out here |
| 27 | // instead of pulled from ggml-cuda.h/ggml-vulkan.h because those headers resolve against the |
| 28 | // backend's own build flags, which are not visible from this translation unit. |
| 29 | struct BackendRegNames { |
| 30 | BackendType type; |
| 31 | const char * names[3]; // unused entries are nullptr |
| 32 | }; |
| 33 | |
| 34 | constexpr BackendRegNames k_backend_reg_names[] = { |
| 35 | {BackendType::Cuda, {"CUDA", "MUSA", nullptr}}, |
| 36 | {BackendType::Hip, {"ROCm", nullptr, nullptr}}, |
| 37 | {BackendType::Vulkan, {"Vulkan", nullptr, nullptr}}, |
| 38 | {BackendType::Metal, {"MTL", nullptr, nullptr}}, |
| 39 | }; |
| 40 | |
| 41 | bool reg_name_matches(BackendType type, const char * reg_name) { |
| 42 | if (reg_name == nullptr) { |
no test coverage detected