-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from UoB-HPC/bugfix/build
Simplify build system
- Loading branch information
Showing
14 changed files
with
299 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.