From ea12f2a9a13041ad114b3828ef51e2e17aa12e88 Mon Sep 17 00:00:00 2001 From: Peter Steinbach Date: Mon, 13 Mar 2017 14:41:16 +0100 Subject: [PATCH 1/3] added EXTRA_FLAGS variable to CUDA Makefile to provide the freedom to specify debug flags or gencode flags --- CUDA.make | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CUDA.make b/CUDA.make index ef193df6..bf376eb9 100644 --- a/CUDA.make +++ b/CUDA.make @@ -1,6 +1,7 @@ +EXTRA_FLAGS?=-O3 cuda-stream: main.cpp CUDAStream.cu - nvcc -std=c++11 -O3 -DCUDA $^ $(EXTRA_FLAGS) -o $@ + nvcc -std=c++11 -DCUDA $^ $(EXTRA_FLAGS) -o $@ .PHONY: clean clean: From 8c7a801a8422a145ced2eb3448eaa016d6a553d4 Mon Sep 17 00:00:00 2001 From: Peter Steinbach Date: Mon, 13 Mar 2017 15:22:26 +0100 Subject: [PATCH 2/3] put -O3 into CXXFLAGS to comply with OpenMP.make --- CUDA.make | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CUDA.make b/CUDA.make index bf376eb9..50f175cd 100644 --- a/CUDA.make +++ b/CUDA.make @@ -1,7 +1,7 @@ -EXTRA_FLAGS?=-O3 +CXXFLAGS?=-O3 -std=c++11 cuda-stream: main.cpp CUDAStream.cu - nvcc -std=c++11 -DCUDA $^ $(EXTRA_FLAGS) -o $@ + nvcc $(CXXFLAGS) -DCUDA $^ $(EXTRA_FLAGS) -o $@ .PHONY: clean clean: From d8cb7494e0c8e7beddaffadad97f0c7c0238ca71 Mon Sep 17 00:00:00 2001 From: Peter Steinbach Date: Fri, 17 Mar 2017 15:18:13 +0100 Subject: [PATCH 3/3] pulled -O3 out into CXXFLAGS, refactored CUDA compiler into CUDA_CXX make variable to cope with clang as CUDA compiler as well --- CUDA.make | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CUDA.make b/CUDA.make index 50f175cd..3edf0f51 100644 --- a/CUDA.make +++ b/CUDA.make @@ -1,7 +1,8 @@ -CXXFLAGS?=-O3 -std=c++11 +CXXFLAGS=-O3 +CUDA_CXX=nvcc cuda-stream: main.cpp CUDAStream.cu - nvcc $(CXXFLAGS) -DCUDA $^ $(EXTRA_FLAGS) -o $@ + $(CUDA_CXX) -std=c++11 $(CXXFLAGS) -DCUDA $^ $(EXTRA_FLAGS) -o $@ .PHONY: clean clean: