ggml : also check ggml_backend_is_cpu

This commit is contained in:
Georgi Gerganov 2024-01-07 12:26:50 +02:00
parent cdb81d4ea1
commit 44c93c6746
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -703,7 +703,7 @@ ggml_backend_t ggml_backend_cpu_init(void) {
}
bool ggml_backend_is_cpu(ggml_backend_t backend) {
return backend->iface.get_name == ggml_backend_cpu_name;
return backend && backend->iface.get_name == ggml_backend_cpu_name;
}
void ggml_backend_cpu_set_n_threads(ggml_backend_t backend_cpu, int n_threads) {