Skip to content

Commit

Permalink
Merge pull request #24 from UoB-HPC/bugfix/build
Browse files Browse the repository at this point in the history
Simplify build system
  • Loading branch information
tomdeakin authored Feb 25, 2017
2 parents ce4f49e + 2416727 commit 4d24e23
Show file tree
Hide file tree
Showing 14 changed files with 299 additions and 478 deletions.
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@

gpu-stream-cuda
gpu-stream-ocl
gpu-stream-acc
gpu-stream-omp3
gpu-stream-omp45
gpu-stream-sycl
cuda-stream
ocl-stream
omp-stream
acc-stream
raja-stream
kokkos-stream
sycl-stream
hip-stream

*.o
*.bc
*.sycl
*.tar
*.gz

.DS_Store

CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Makefile
197 changes: 0 additions & 197 deletions CMakeLists.txt

This file was deleted.

8 changes: 8 additions & 0 deletions CUDA.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

cuda-stream: main.cpp CUDAStream.cu
nvcc -std=c++11 -O3 -DCUDA $^ $(EXTRA_FLAGS) -o $@

.PHONY: clean
clean:
rm -f cuda-stream

18 changes: 18 additions & 0 deletions HIP.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# TODO: HIP with HCC

HIPCC = hipcc

ifndef CUDA_PATH
ifeq (,$(wildcard /usr/local/bin/nvcc))
$(error /usr/local/bin/nvcc not found, set CUDA_PATH instead)
endif
endif

hip-stream: main.cpp HIPStream.cu
$(HIPCC) $(CXXFLAGS) -std=c++11 -DHIP $^ $(EXTRA_FLAGS) -o $@

.PHONY: clean
clean:
rm -f hip-stream

30 changes: 30 additions & 0 deletions Kokkos.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

default: kokkos-stream

include $(KOKKOS_PATH)/Makefile.kokkos

ifndef TARGET
define target_help
Set TARGET to change to offload device. Defaulting to CPU.
Available targets are:
CPU (default)
GPU
endef
$(info $(target_help))
TARGET=CPU
endif

ifeq ($(TARGET), CPU)
TARGET_DEF = -DKOKKOS_TARGET_CPU
else ifeq ($(TARGET), GPU)
CXX = $(NVCC_WRAPPER)
TARGET_DEF =
endif

kokkos-stream: main.cpp KOKKOSStream.cpp $(KOKKOS_CPP_DEPENDS)
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(KOKKOS_LDFLAGS) main.cpp KOKKOSStream.cpp $(KOKKOS_LIBS) -o $@ -DKOKKOS $(TARGET_DEF) -O3 $(EXTRA_FLAGS)

.PHONY: clean
clean:
rm -f kokkos-stream

10 changes: 0 additions & 10 deletions KokkosCPUMakefile

This file was deleted.

11 changes: 0 additions & 11 deletions KokkosMakefile

This file was deleted.

52 changes: 52 additions & 0 deletions OpenACC.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

ifndef COMPILER
define compiler_help
Set COMPILER to ensure correct flags are set.
Available compilers are:
PGI CRAY
endef
$(info $(compiler_help))
endif

COMPILER_ = $(CXX)
COMPILER_PGI = pgc++
COMPILER_CRAY = CC

FLAGS_ = -O3 -std=c++11

FLAGS_PGI = -std=c++11 -O3 -acc
ifeq ($(COMPILER), PGI)
define target_help
Set a TARGET to ensure PGI targets the correct offload device.
Available targets are:
SNB, IVB, HSW
KEPLER, MAXWELL, PASCAL
HAWAII
endef
ifndef TARGET
$(error $(target_help))
endif
TARGET_FLAGS_SNB = -ta=multicore -tp=sandybridge
TARGET_FLAGS_IVB = -ta=multicore -tp=ivybridge
TARGET_FLAGS_HSW = -ta=multicore -tp=haswell
TARGET_FLAGS_KEPLER = -ta=nvidia:cc35
TARGET_FLAGS_MAXWELL = -ta=nvidia:cc50
TARGET_FLAGS_PASCAL = -ta=nvidia:cc60
TARGET_FLAGS_HAWAII = -ta=radeon:hawaii
ifeq ($(TARGET_FLAGS_$(TARGET)),)
$(error $(target_help))
endif

FLAGS_PGI += $(TARGET_FLAGS_$(TARGET))

endif

FLAGS_CRAY = -hstd=c++11
CXXFLAGS = $(FLAGS_$(COMPILER))

acc-stream: main.cpp ACCStream.cpp
$(COMPILER_$(COMPILER)) $(CXXFLAGS) -DACC $^ $(EXTRA_FLAGS) -o $@

.PHONY: clean
clean:
rm -f acc-stream main.o ACCStream.o
Loading

0 comments on commit 4d24e23

Please sign in to comment.