| 417 | size_t total_bytes = 0; |
| 418 | ggml_backend_dev_memory(device, &free_bytes, &total_bytes); |
| 419 | if (total_bytes > 0 && free_bytes <= total_bytes) { |
| 420 | snapshot.available = true; |
| 421 | snapshot.total_bytes = static_cast<int64_t>(total_bytes); |
| 422 | snapshot.free_bytes = static_cast<int64_t>(free_bytes); |
| 423 | snapshot.used_bytes = static_cast<int64_t>(total_bytes - free_bytes); |
| 424 | } |
| 425 | } |
| 426 | (void)device_hint; |
| 427 | return snapshot; |
| 428 | } |
| 429 | |
| 430 | BackendMemorySnapshot query_backend_memory(const BackendConfig & config) { |
| 431 | BackendMemorySnapshot snapshot; |
| 432 | switch (config.type) { |
| 433 | case BackendType::Cpu: |
| 434 | return snapshot; |
no test coverage detected