]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
build : update CBLAS flags + fix unused var warning (#0)
authorGeorgi Gerganov <redacted>
Mon, 19 Feb 2024 12:44:46 +0000 (14:44 +0200)
committerGeorgi Gerganov <redacted>
Mon, 19 Feb 2024 12:44:46 +0000 (14:44 +0200)
CMakeLists.txt
Makefile
whisper.cpp

index 7b7c6a850388de57c89e4163dd70d7cd4ef02a7a..4c6a844beedb755e27de47f4ebf8130a61b36c85 100644 (file)
@@ -116,7 +116,7 @@ if (APPLE)
             message(STATUS "Accelerate framework found")
 
             set(WHISPER_EXTRA_LIBS  ${WHISPER_EXTRA_LIBS}  ${ACCELERATE_FRAMEWORK})
-            set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_ACCELERATE)
+            set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_ACCELERATE -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64)
         else()
             message(FATAL_ERROR "Accelerate framework not found")
         endif()
index 382568786c3b38fdc4c2959cff8e8d4f0ae46e07..93c89cd8109aca2297cafd8b4bf913a2f0d98843 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -185,6 +185,8 @@ ifndef WHISPER_NO_ACCELERATE
        # Mac M1 - include Accelerate framework
        ifeq ($(UNAME_S),Darwin)
                CFLAGS  += -DGGML_USE_ACCELERATE
+               CFLAGS  += -DACCELERATE_NEW_LAPACK
+               CFLAGS  += -DACCELERATE_LAPACK_ILP64
                LDFLAGS += -framework Accelerate
        endif
 endif
index 536adc3396dc469941e940b23caeb8b98523a1d9..38c827d2efae801c7174021d9c6045e311c2860c 100644 (file)
@@ -1616,8 +1616,7 @@ static bool whisper_encode_external(const whisper_state & wstate) {
 
 static struct ggml_cgraph * whisper_build_graph_conv(
         whisper_context & wctx,
-          whisper_state & wstate,
-              const int   mel_offset) {
+          whisper_state & wstate) {
     const auto & model   = wctx.model;
     const auto & hparams = model.hparams;
 
@@ -2001,7 +2000,7 @@ static bool whisper_encode_internal(
     {
         auto & alloc = wstate.alloc_conv.alloc;
 
-        ggml_cgraph * gf = whisper_build_graph_conv(wctx, wstate, mel_offset);
+        ggml_cgraph * gf = whisper_build_graph_conv(wctx, wstate);
 
         if (!ggml_gallocr_alloc_graph(alloc, gf)) {
             // should never happen as we pre-allocate the memory
@@ -3024,7 +3023,7 @@ struct whisper_state * whisper_init_state(whisper_context * ctx) {
     {
         bool ok = whisper_allocr_graph_init(state->alloc_conv, ctx->backend,
                 [&]() {
-                    return whisper_build_graph_conv(*ctx, *state, 0);
+                    return whisper_build_graph_conv(*ctx, *state);
                 });
 
         if (!ok) {