Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for Tulip #1278

Merged
merged 1 commit into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 2 additions & 27 deletions Tools/GNUMake/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ else
endif

ifeq ($(USE_HIP),TRUE)
DEBUG := FALSE # Currently there is a compiler bug for DEBUG=TRUE.
USE_CUDA := FALSE
COMP := hip
HIP_PLATFORM = $(shell hipconfig --compiler)
Expand Down Expand Up @@ -347,9 +348,7 @@ SKIP_LINKING ?= FALSE
USE_COMPILE_PIC ?= FALSE

AMREX_GIT_VERSION := $(shell cd $(AMREX_HOME); git describe --abbrev=12 --dirty --always --tags)
ifneq ($(USE_HIP),TRUE)
DEFINES += -DAMREX_GIT_VERSION=\"$(AMREX_GIT_VERSION)\"
endif
DEFINES += -DAMREX_GIT_VERSION=\"$(AMREX_GIT_VERSION)\"

FORTLINK = UNDERSCORE

Expand Down Expand Up @@ -644,30 +643,6 @@ endif
ifeq ($(USE_HIP),TRUE)

USE_GPU := TRUE
AMREX_FCOMP ?= gnu
AMREX_CCOMP ?= hip

ifneq ($(lowercase_comp),gnu)
else ifneq ($(lowercase_comp),hip)
$(error HIP can only be used with COMP=hip)
endif

# include $(AMREX_HOME)/Tools/GNUMake/comps/hip.mak

ifeq ($(USE_MPI),TRUE)
# $(error MPI is not supported with HIP)

export OMPI_CC := hipcc
export OMPI_CXX := hipcc
export OMPI_F77 := $(FC)
export OMPI_FC := $(F90)

export MPICH_CC := hipcc
export MPICH_CXX := hipcc
export MPICH_F77 := $(FC)
export MPICH_FC := $(F90)

endif

DEFINES += -DAMREX_USE_HIP -DAMREX_HIP_PLATFORM=$(HIP_PLATFORM)

Expand Down
4 changes: 4 additions & 0 deletions Tools/GNUMake/Make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ endif
@if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi
ifeq ($(USE_DPCPP),TRUE)
$(CXX) $(CXXDEPFLAGS) $< -o $@
else ifeq ($(USE_HIP),TRUE)
$(CXX) $(CXXDEPFLAGS) $< -o $@
else
$(CXX) $(CXXDEPFLAGS) $< > $@
endif
Expand All @@ -313,6 +315,8 @@ endif
@if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi
ifeq ($(USE_DPCPP),TRUE)
$(CC) $(CDEPFLAGS) $< -o $@
else ifeq ($(USE_HIP),TRUE)
$(CC) $(CDEPFLAGS) $< -o $@
else
$(CC) $(CDEPFLAGS) $< > $@
endif
Expand Down
11 changes: 11 additions & 0 deletions Tools/GNUMake/sites/Make.frontier-coe
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@ else
CXXFLAGS += --amdgpu-target=gfx906,gfx908
HIPCC_FLAGS += --amdgpu-target=gfx906,gfx908
endif

ifeq ($(USE_MPI),TRUE)
INCLUDE_LOCATIONS += $(MPI_HOME)/include
LIBRARY_LOCATIONS += $(MPI_HOME)/lib
mpicxx_link_flags := $(shell mpicxx -link_info)
LIBRARIES += $(filter -Wl%,$(mpicxx_link_flags))
ifneq ($(BL_NO_FORT),TRUE)
LIBRARIES += -lmpifort
endif
LIBRARIES += -lmpi
endif
endif