From: Abhilash Majumder Date: Fri, 23 Feb 2024 07:22:24 +0000 (+0530) Subject: whisper : add SYCL support (whisper/1863) X-Git-Tag: upstream/0.0.1642~900 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ef1778ce2c5cc6e32d8e0379ef25782f08b80c97;p=pkg%2Fggml%2Fsources%2Fggml whisper : add SYCL support (whisper/1863) * add changes from llama upstream * add sycl abstraction * add sycl build * update cmake * add sycl build config * fix bug * fix bug * refactor build * fix bug * update build * call build * use sycl header * add examples * add target * fix typecast in quant.c * readd fp16 and readme * fix quant typecast * add sample * add readme * remove cxx file check --- diff --git a/examples/whisper/whisper.cpp b/examples/whisper/whisper.cpp index 38c827d2..2e0a6e2e 100644 --- a/examples/whisper/whisper.cpp +++ b/examples/whisper/whisper.cpp @@ -12,6 +12,10 @@ #include "ggml-cuda.h" #endif +#ifdef GGML_USE_SYCL +#include "ggml-sycl.h" +#endif + #ifdef WHISPER_USE_OPENVINO #include "openvino/whisper-openvino-encoder.h" #endif @@ -1052,6 +1056,16 @@ static ggml_backend_t whisper_backend_init(const whisper_context_params & params } #endif +#ifdef GGML_USE_SYCL + if (params.use_gpu) { + WHISPER_LOG_INFO("%s: using SYCL backend\n", __func__); + backend_gpu = ggml_backend_sycl_init(params.gpu_device); + if (!backend_gpu) { + WHISPER_LOG_ERROR("%s: ggml_backend_sycl_init() failed\n", __func__); + } + } +#endif + if (backend_gpu) { return backend_gpu; }