Skip to content

Commit

Permalink
make : add WHISPER_CUBLAS
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Apr 29, 2023
1 parent 0ccd674 commit 582f559
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Makefile
Expand Up @@ -157,6 +157,17 @@ ifdef WHISPER_OPENBLAS
LDFLAGS += -lopenblas
endif

ifdef WHISPER_CUBLAS
CFLAGS += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include
CXXFLAGS += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include
LDFLAGS += -lcublas -lculibos -lcudart -lcublasLt -lpthread -ldl -lrt -L/usr/local/cuda/lib64 -L/opt/cuda/lib64 -L$(CUDA_PATH)/targets/x86_64-linux/lib
OBJS += ggml-cuda.o
NVCC = nvcc
NVCCFLAGS = --forward-unknown-to-host-compiler -arch=native
ggml-cuda.o: ggml-cuda.cu ggml-cuda.h
$(NVCC) $(NVCCFLAGS) $(CXXFLAGS) -Wno-pedantic -c $< -o $@
endif

ifdef WHISPER_GPROF
CFLAGS += -pg
CXXFLAGS += -pg
Expand Down Expand Up @@ -206,11 +217,11 @@ default: main bench
# Build library
#

ggml.o: ggml.c ggml.h
$(CC) $(CFLAGS) -c ggml.c -o ggml.o
ggml.o: ggml.c ggml.h ggml-cuda.h
$(CC) $(CFLAGS) -c $< -o $@

whisper.o: whisper.cpp whisper.h ggml.h
$(CXX) $(CXXFLAGS) -c whisper.cpp -o whisper.o
whisper.o: whisper.cpp whisper.h ggml.h ggml-cuda.h
$(CXX) $(CXXFLAGS) -c $< -o $@

ifndef WHISPER_COREML
WHISPER_OBJ = whisper.o
Expand Down

0 comments on commit 582f559

Please sign in to comment.