From 07f91e605edf5f86de31b3e4c980b7c1ea33d7d0 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Thu, 23 Feb 2017 15:52:43 +0000 Subject: [PATCH] Add Makefile for RAJA --- RAJA.make | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 RAJA.make diff --git a/RAJA.make b/RAJA.make new file mode 100644 index 0000000..72cc5a6 --- /dev/null +++ b/RAJA.make @@ -0,0 +1,32 @@ + +ifndef TARGET +$(info No target defined. Specify CPU or GPU. Defaulting to CPU) +TARGET=CPU +endif + +ifeq ($(TARGET), CPU) +COMP=$(CXX) +CFLAGS = -O3 -std=c++11 -DRAJA_TARGET_CPU + +ifndef COMPILER +$(error No COMPILER defined. Specify COMPILER for correct OpenMP flag.) +endif +ifeq ($(COMPILER), INTEL) +COMP = icpc +CFLAGS += -qopenmp +else ifeq ($(COMPILER), GNU) +COMP = g++ +CFLAGS += -fopenmp +else ifeq ($(COMPILER), CRAY) +COMP = CC +CFLAGS += +endif + +else ifeq ($(TARGET), GPU) +COMP = nvcc +CFLAGS = --expt-extended-lambda -O3 -std=c++11 -x cu -Xcompiler -fopenmp +endif + +raja-stream: main.cpp RAJAStream.cpp + $(COMP) $(CFLAGS) -DUSE_RAJA -I$(RAJA_PATH)/include $^ -L$(RAJA_PATH)/lib -lRAJA -o $@ +