File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,17 @@ ifdef WHISPER_OPENBLAS
157157 LDFLAGS += -lopenblas
158158endif
159159
160+ ifdef WHISPER_CUBLAS
161+ CFLAGS += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include
162+ CXXFLAGS += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include
163+ 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
164+ OBJS += ggml-cuda.o
165+ NVCC = nvcc
166+ NVCCFLAGS = --forward-unknown-to-host-compiler -arch=native
167+ ggml-cuda.o : ggml-cuda.cu ggml-cuda.h
168+ $(NVCC ) $(NVCCFLAGS ) $(CXXFLAGS ) -Wno-pedantic -c $< -o $@
169+ endif
170+
160171ifdef WHISPER_GPROF
161172 CFLAGS += -pg
162173 CXXFLAGS += -pg
@@ -206,11 +217,11 @@ default: main bench
206217# Build library
207218#
208219
209- ggml.o : ggml.c ggml.h
210- $(CC ) $(CFLAGS ) -c ggml.c -o ggml.o
220+ ggml.o : ggml.c ggml.h ggml-cuda.h
221+ $(CC ) $(CFLAGS ) -c $< -o $@
211222
212- whisper.o : whisper.cpp whisper.h ggml.h
213- $(CXX ) $(CXXFLAGS ) -c whisper.cpp -o whisper.o
223+ whisper.o : whisper.cpp whisper.h ggml.h ggml-cuda.h
224+ $(CXX ) $(CXXFLAGS ) -c $< -o $@
214225
215226ifndef WHISPER_COREML
216227WHISPER_OBJ = whisper.o
You can’t perform that action at this time.
0 commit comments