| 69 | } |
| 70 | |
| 71 | int current_device_id() { |
| 72 | #if defined(DFLASH27B_BACKEND_CUDA) || defined(DFLASH27B_BACKEND_HIP) || defined(GGML_USE_HIP) |
| 73 | int device = -1; |
| 74 | if (cudaGetDevice(&device) != cudaSuccess || device < 0) { |
| 75 | return -1; |
| 76 | } |
| 77 | return device; |
| 78 | #else |
| 79 | return -1; |
| 80 | #endif |
| 81 | } |
| 82 | |
| 83 | int device_props_for(int device, |
| 84 | std::string * device_name, |
no outgoing calls
no test coverage detected