Commit 8ad0a2aa authored by Morales Hernandez, Mario's avatar Morales Hernandez, Mario
Browse files

Merge branch '25k/hip-header-port' into 'master'

Add support for hip

See merge request hydro/triton!2

Former-commit-id: 522c23c4
parents 0ebc6815 81577011
Loading
Loading
Loading
Loading
+29 −20
Original line number Diff line number Diff line
ifndef BUILDDIR
	BUILDDIR=./build
endif
ifndef SRCDIR
	SRCDIR=./src
endif
hpc_gpu:
	make -f makefile.hpc ACTIVE_GPU=1
	make -f makefile.hpc ACTIVE_GPU=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR)

hpc_omp:
	make -f makefile.hpc ACTIVE_OMP=1
	make -f makefile.hpc ACTIVE_OMP=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR)

summit_gpu:
	make -f makefile.summit ACTIVE_GPU=1
	make -f makefile.summit ACTIVE_GPU=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR)

summit_omp:
	make -f makefile.summit ACTIVE_OMP=1
	make -f makefile.summit ACTIVE_OMP=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR)

afw_gpu:
	make -f makefile.afw ACTIVE_GPU=1
	make -f makefile.afw ACTIVE_GPU=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR)

afw_omp:
	make -f makefile.afw ACTIVE_OMP=1
	make -f makefile.afw ACTIVE_OMP=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR)

frontier_gpu:
	make -f makefile.frontier ACTIVE_GPU=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR)

clean:
	rm -rf ./build/triton
	rm -rf $(BUILDDIR)/triton
+3 −3
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ else
	DFLAGS := -DACTIVE_OMP=1
endif

triton: src/main.cpp
	if [ ! -d "build" ]; then mkdir build; fi
triton: $(SRCDIR)/main.cpp
	if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi
	@echo 'Compiling file: $<'
	$(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "build/$@" "$<" --std=c++11
	$(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "$(BUILDDIR)/$@" "$<" --std=c++11
	@echo 'Building finished: $@'

makefile.frontier

0 → 100644
+11 −0
Original line number Diff line number Diff line
CC := hipcc
INC_DIRS := $(HIP_PATH)/include/hip  $(MPICH_DIR)/include
FLAGS := --rocm-path=$(ROCM_PATH) --offload-arch=gfx90a -x hip
LIBRARIES := -L$(MPICH_DIR)/lib -L$(HIP_PATH)/../lib -lmpi
DFLAGS := -D__HIP_ROCclr__ -D__HIP_ARCH_GFX90A__=1 -DACTIVE_GPU=1 -DAMDGPU=1

triton: $(SRCDIR)/main.cpp
	if [ ! -d "$(BUILDDIR)" ]; then mkdir $(BUILDDIR); fi
	@echo 'Compiling file: $<'
	$(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "$(BUILDDIR)/$@" "$<" --std=c++11
	@echo 'Building finished: $@'
+3 −3
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ else
	DFLAGS := -DACTIVE_OMP=1
endif

triton: src/main.cpp
	if [ ! -d "build" ]; then mkdir build; fi
triton: $(SRCDIR)/main.cpp
	if [ ! -d "$(BUILDDIR)" ]; then mkdir $(BUILDDIR); fi
	@echo 'Compiling file: $<'
	$(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "build/$@" "$<" --std=c++17
	$(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "$(BUILDDIR)/$@" "$<" --std=c++17
	@echo 'Building finished: $@'
+4 −4
Original line number Diff line number Diff line
ifdef ACTIVE_GPU
	CC := nvcc
	INC_DIRS := $(OMPI_DIR)/include
	INC_DIRS := $(OMPI_DIR)/include $(CUDA_DIR)/include
	FLAGS := -arch=sm_70 -x cu
	LIBRARIES := -L$(OMPI_DIR)/lib -L$(CUDA_DIR)/targets/ppc64le-linux/lib/stubs -lmpi_ibm -lnvidia-ml
	DFLAGS := -DACTIVE_GPU=1
@@ -12,8 +12,8 @@ else
	DFLAGS := -DACTIVE_OMP=1
endif

triton: src/main.cpp
	if [ ! -d "build" ]; then mkdir build; fi
triton: $(SRCDIR)/main.cpp
	if [ ! -d "$(BUILDDIR)" ]; then mkdir $(BUILDDIR); fi
	@echo 'Compiling file: $<'
	$(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "build/$@" "$<" --std=c++11
	$(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "$(BUILDDIR)/$@" "$<" --std=c++11
	@echo 'Building finished: $@'
Loading