Page MenuHomec4science

MakefileFloat.GPU.intel
No OneTemporary

File Metadata

Created
Mon, Nov 18, 20:34

MakefileFloat.GPU.intel

#
#
PROGRAM_NAME := ChiBenchmark_GPU
#all: $(PROGRAM_NAME_GPU) $(PROGRAM_NAME)
all: $(PROGRAM_NAME) $(PROGRAM_NAME_GPU)
#CXX=g++ -lm -ffast-math -ftree-loop-vectorize
CXX=icpc
#
program_CXX_SRCS := $(wildcard *.cpp)
program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o}
#
program_C_SRCS := $(wildcard *.c)
program_C_OBJS := ${program_C_SRCS:.c=.o}
#
program_CU_SRCS := $(wildcard *.cu)
program_CU_OBJS := ${program_CU_SRCS:.cu=.cu.o}
#
# include
#
program_INCLUDE_DIRS := . /usr/local/cuda/include/ #C++ Include directories
program_INCLUDE_DIRS += $(CFITSIO_ROOT)/include
program_INCLUDE_DIRS += $(LENSTOOL_ROOT)/include
program_INCLUDE_DIRS += $(GSL_ROOT)/include
program_INCLUDE_DIRS += $(LENSTOOLHPC_ROOT)/src
#
# libs
#
program_INCLUDE_LIBS += $(CFITSIO_ROOT)/lib #Include libraries
program_INCLUDE_LIBS += $(LENSTOOL_ROOT)/src
program_INCLUDE_LIBS += $(LENSTOOL_ROOT)/liblt
program_INCLUDE_LIBS += $(LENSTOOLHPC_ROOT)/src
program_INCLUDE_LIBS += $(GSL_ROOT)/lib
program_INCLUDE_LIBS += $(WCSTOOL_ROOT)
#
#
# Compiler flags
CPPFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir))
CPPFLAGS += $(foreach includelib,$(program_INCLUDE_LIBS),-L$(includelib))
#CPPFLAGS += -D__WITH_LENSTOOL
CPPFLAGS += -qopenmp -xHost -g -O3 -std=c++0x -Wall -pedantic
CPPFLAGS += -fma -qopenmp -ftz
CPPFLAGS += -xHost -pedantic
CPPFLAGS += -fPIC
#CPPFLAGS += -fp-model strict -fp-model extended
#CPPFLAGS += -D_double
#CPPFLAGS += -no-vec
#CPPFLAGS += -qopenmp -march=core-avx2 -g -O3 -std=c++0x -Wall -pedantic
#CPPFLAGS += -llenstoolhpc -qopenmp -xHost -g -O3 -std=c++0x -Wall -pedantic
#CPPFLAGS += -llenstoolhpc -qopenmp -axMIC-AVX512,CORE-AVX2 -g -O3 -std=c++0x -Wall -pedantic
#CPPFLAGS += -qopt-prefetch-distance=64,8 -qopt-streaming-cache-evict=0 -llenstoolhpc -qopenmp -xMIC-AVX512 -g -O3 -std=c++0x -Wall -pedantic
#LDFLAGS := -llenstool -llenstoolhpc -llt -lcfitsio -lwcs -lgsl -lgslcblas
LDFLAGS := -llenstoolhpc -llt -lcfitsio -lwcs -lgsl -lgslcblas
#
#NVFLAGS := -O3 -g -G -rdc=true -ccbin icpc -Xcompiler '-Wall -fPIC -qopenmp' -D__WITH_LENSTOOL
NVFLAGS := -O3 -ccbin icpc -Xcompiler '-Wall -fPIC' #-D__WITH_LENSTOOL
#NVFLAGS += -D_double
NVFLAGS += -gencode arch=compute_60,code=sm_60
NVFLAGS += -use_fast_math
#NVFLAGS += -arch=sm_35
NVFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir))
NVFLAGS += $(foreach includelib,$(program_INCLUDE_LIBS),-L$(includelib))
#
NVLDFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir))
NVLDFLAGS += $(foreach includelib,$(program_INCLUDE_LIBS),-L$(includelib))
NVLDFLAGS += -lcudart -lcudadevrt
#
LDFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir))
LDFLAGS += $(foreach includelib,$(program_INCLUDE_LIBS),-L$(includelib))
NVLDFLAGS += $(LDFLAGS)
#
LDFLAGS += -O3 -g -liomp5
#LDFLAGS += -qopenmp
#
#
GPU_OBJECTS = $(program_CU_OBJS)
CPU_OBJECTS = $(program_CXX_OBJS) $(program_C_OBJS)
#
%.cu.o: %.cu %.cuh
nvcc $(NVFLAGS) -o $@ -c $<
#nvcc $(NVFLAGS) -o $@ -rdc=true $<
#nvcc $(NVFLAGS) -Xptxas -dlcm=cg --ptxas-options=-v -o $@ -dc $<
#
%.cpp: %.cpp %.h
$(CXX) $(CXXFLAGS) -o $@ $< $(CPPFLAGS)
#
$(PROGRAM_NAME): $(GPU_OBJECTS)
nvcc -arch=sm_60 $(program_CU_OBJS) --shared -o liblenstoolhpc_GPU.so
#$(PROGRAM_NAME): $(CPU_OBJECTS)
# icpc -o $@ $^ $(LDFLAGS)
clean:
@- $(RM) $(PROGRAM_NAME) $(OBJECTS) *~ *.o *.optrpt
distclean: clean
.PHONY: all clean distclean

Event Timeline