Skip to content

Commit ade20ae

Browse files
cuda: In tests/Makefile add a conditional check to append -Wno-deprecated-gpu-targets for Cuda Toolkit 12.8 and 12.9
1 parent 71ae39f commit ade20ae

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/cuda/tests/Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ TESTS_NOCTX = concurrent_profiling_noCuCtx pthreads_noCuCtx \
1515
NVCC = $(PAPI_CUDA_ROOT)/bin/nvcc
1616
NVCC_VERSION := $(shell $(NVCC) --version | grep -oP '(?<=release )\d+\.\d+')
1717

18+
PAPI_FLAG = -DPAPI # Comment this line for tests to run without PAPI profiling
19+
NVCFLAGS = -g -ccbin='$(CC)' $(PAPI_FLAG)
20+
21+
# Check to see if the Cuda Toolkit version is either 12.8 or 12.9 such that
22+
# we can add -Wno-deprecated-gpu-targets to avoid compilation warning
23+
CUDA_TOOLKIT_EQUAL_TO_12_8_OR_12_9 := $(shell echo "$(NVCC_VERSION)" | awk '{print ($$1 == 12.8 || $$1 == 12.9)}')
24+
ifeq ($(CUDA_TOOLKIT_EQUAL_TO_12_8_OR_12_9), 1)
25+
NVCFLAGS += -Wno-deprecated-gpu-targets
26+
endif
27+
1828
# Check to see if we are using a Cuda Toolkit version greater than or equal to 13
1929
# as the API call for cuCtxCreate changed at this version
2030
CUDA_TOOLKIT_GE_13 := $(shell echo "$(NVCC_VERSION) 13.0" | awk '{print $$1 >= $$2}')
@@ -23,8 +33,6 @@ ifeq ($(CUDA_TOOLKIT_GE_13), 1)
2333
CUDA_CPPFLAGS += -DCUDA_TOOLKIT_GE_13
2434
endif
2535

26-
PAPI_FLAG = -DPAPI # Comment this line for tests to run without PAPI profiling
27-
NVCFLAGS = -g -ccbin='$(CC)' $(PAPI_FLAG)
2836
ifeq ($(BUILD_SHARED_LIB),yes)
2937
NVCFLAGS += -Xcompiler -fpic
3038
endif

0 commit comments

Comments
 (0)