From: Georgi Gerganov Date: Fri, 29 Dec 2023 16:53:34 +0000 (+0200) Subject: clip : use ggml_backend_buffer_is_host (#4205) X-Git-Tag: upstream/0.0.4488~2760 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=0235b9b571f3cc7d2b8836409a5404b41ce1379c;p=pkg%2Fggml%2Fsources%2Fllama.cpp clip : use ggml_backend_buffer_is_host (#4205) --- diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index f9326a5c..6a731eee 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -598,11 +598,7 @@ struct clip_ctx * clip_model_load(const char * fname, const int verbosity = 1) { return nullptr; } int num_bytes = ggml_nbytes(cur); - if (ggml_backend_is_cpu(new_clip->backend) -#ifdef GGML_USE_METAL - || ggml_backend_is_metal(new_clip->backend) -#endif - ) { + if (ggml_backend_buffer_is_host(new_clip->params_buffer)) { // for the CPU and Metal backend, we can read directly into the tensor fin.read(reinterpret_cast(cur->data), num_bytes); } else {