File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,12 @@ REMOVE_FILES = rm -f
11
11
OUTPUT_FILE = -o $@
12
12
CUDA_OUTPUT_FILE = -o $@
13
13
14
+ # Default O3 CPU optimization level for NVCC (0 for fastest compile time)
15
+ FORCE_NVCC_O ?= 3
16
+
14
17
# NVCC flags
15
18
# -t=0 is short for --threads, 0 = number of CPUs on the machine
16
- NVCC_FLAGS = -O3 -t=0 --use_fast_math -std=c++17
19
+ NVCC_FLAGS = --threads=0 -t=0 --use_fast_math -std=c++17 -O $( FORCE_NVCC_O )
17
20
NVCC_LDFLAGS = -lcublas -lcublasLt
18
21
NVCC_INCLUDES =
19
22
NVCC_LDLIBS =
45
48
46
49
ifneq ($(CI ) ,true) # if not in CI, then use the GPU query
47
50
ifndef GPU_COMPUTE_CAPABILITY # set to defaults if : make GPU_COMPUTE_CAPABILITY=
48
- ifneq ($(call file_exists_in_path, __nvcc_device_query ),)
49
- GPU_COMPUTE_CAPABILITY = $(shell __nvcc_device_query )
51
+ ifneq ($(call file_exists_in_path, nvidia-smi ),)
52
+ GPU_COMPUTE_CAPABILITY = $(shell nvidia-smi --query-gpu=compute_cap --format=csv,noheader | sed 's/\.//g' )
50
53
GPU_COMPUTE_CAPABILITY := $(strip $(GPU_COMPUTE_CAPABILITY ) )
51
54
endif
52
55
endif
You can’t perform that action at this time.
0 commit comments