Skip to content

Commit

Permalink
#34 Enable Metal in Makevars
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijffels committed Jan 29, 2024
1 parent 26614e0 commit c1a3a88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,18 @@ ifdef WHISPER_COREML_ALLOW_FALLBACK
endif
endif

SOURCES_METAL =
OBJECTS_METAL =
ifdef WHISPER_METAL
ifeq ($(UNAME_S),Darwin)
WHISPER_METAL := 1

PKG_CFLAGS += -DGGML_USE_METAL
PKG_CPPFLAGS += -DGGML_USE_METAL
PKG_LIBS += -framework Foundation -framework Metal -framework MetalKit

SOURCES_METAL =+ ggml-metal.m
OBJECTS_METAL =+ ggml-metal.o
endif
endif

Expand Down Expand Up @@ -246,3 +251,8 @@ $(info )

SOURCES = whisper_cpp/ggml-quants.c whisper_cpp/ggml-backend.c whisper_cpp/ggml-alloc.c whisper_cpp/ggml.c whisper_cpp/whisper.cpp whisper_cpp/common-ggml.cpp whisper_cpp/common.cpp rcpp_whisper.cpp RcppExports.cpp
OBJECTS = whisper_cpp/ggml-quants.o whisper_cpp/ggml-backend.o whisper_cpp/ggml-alloc.o whisper_cpp/ggml.o whisper_cpp/whisper.o whisper_cpp/common-ggml.o whisper_cpp/common.o rcpp_whisper.o RcppExports.o

SOURCES += $(SOURCES_METAL)
OBJECTS += $(OBJECTS_METAL)

OBJECTS_METAL =

0 comments on commit c1a3a88

Please sign in to comment.