summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Gäßler <johannesg@5d6.de>2024-06-03 16:28:58 +0200
committerGitHub <noreply@github.com>2024-06-03 16:28:58 +0200
commit0b832d53ba0ffcc759c8d62ede3772dd62321f8e (patch)
treecfa9ff0e1fa79d1f2fb4b799a8d7532ec4a410f4
parent3d7ebf63123b8652fb7bbecef7ba731202309901 (diff)
make: fix debug options not being applied to NVCC (#7714)
-rw-r--r--Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c643fe0c..dca2aafd 100644
--- a/Makefile
+++ b/Makefile
@@ -135,12 +135,16 @@ MK_NVCCFLAGS = -std=c++11
ifdef LLAMA_FAST
MK_CFLAGS += -Ofast
HOST_CXXFLAGS += -Ofast
+ifndef LLAMA_DEBUG
MK_NVCCFLAGS += -O3
+endif # LLAMA_DEBUG
else
MK_CFLAGS += -O3
MK_CXXFLAGS += -O3
+ifndef LLAMA_DEBUG
MK_NVCCFLAGS += -O3
-endif
+endif # LLAMA_DEBUG
+endif # LLAMA_FAST
ifndef LLAMA_NO_CCACHE
CCACHE := $(shell which ccache)
@@ -201,9 +205,10 @@ ifdef LLAMA_SCHED_MAX_COPIES
endif
ifdef LLAMA_DEBUG
- MK_CFLAGS += -O0 -g
- MK_CXXFLAGS += -O0 -g
- MK_LDFLAGS += -g
+ MK_CFLAGS += -O0 -g
+ MK_CXXFLAGS += -O0 -g
+ MK_LDFLAGS += -g
+ MK_NVCCFLAGS += -O0 -g
ifeq ($(UNAME_S),Linux)
MK_CPPFLAGS += -D_GLIBCXX_ASSERTIONS