ggml : fix null backend dereference
This commit is contained in:
parent
72b74f364b
commit
cdb81d4ea1
2 changed files with 2 additions and 2 deletions
|
@ -10140,7 +10140,7 @@ ggml_backend_t ggml_backend_cuda_init(int device) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ggml_backend_is_cuda(ggml_backend_t backend) {
|
bool ggml_backend_is_cuda(ggml_backend_t backend) {
|
||||||
return backend->iface.get_name == ggml_backend_cuda_name;
|
return backend && backend->iface.get_name == ggml_backend_cuda_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ggml_backend_cuda_get_device_count() {
|
int ggml_backend_cuda_get_device_count() {
|
||||||
|
|
|
@ -2749,7 +2749,7 @@ ggml_backend_t ggml_backend_metal_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ggml_backend_is_metal(ggml_backend_t backend) {
|
bool ggml_backend_is_metal(ggml_backend_t backend) {
|
||||||
return backend->iface.get_name == ggml_backend_metal_name;
|
return backend && backend->iface.get_name == ggml_backend_metal_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ggml_backend_metal_set_n_cb(ggml_backend_t backend, int n_cb) {
|
void ggml_backend_metal_set_n_cb(ggml_backend_t backend, int n_cb) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue