Skip to content

Commit

Permalink
HIP Debug Build (#3311)
Browse files Browse the repository at this point in the history
Use -O1 instead of -O0, because the HIP compiler has various issues with
the latter. For example, it segfaults when compiling WarpX. It fails
with errors of size exceeding limit at link time when compiling
Tests/Amr/Advection_AmrCore/Exec. Now both codes work (with GNU Make).

Add -munsafe-fp-atomics in debug mode too.

The changes are for GNU Make only. Even with `-O1`, CMake still does not
work.
  • Loading branch information
WeiqunZhang committed May 12, 2023
1 parent ab567b8 commit 1a96800
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ jobs:
ccache -s
du -hs ~/.cache/ccache
# Make sure CodeQL has something to do
touch Src/Base/AMReX.cpp
export CCACHE_DISABLE=1
cd build
make -j 2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
Expand Down
1 change: 0 additions & 1 deletion Tools/GNUMake/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ else
endif

ifeq ($(USE_HIP),TRUE)
DEBUG := FALSE # Currently there is a compiler bug for DEBUG=TRUE.
USE_CUDA := FALSE
override COMP = hip
ifneq ($(NO_CONFIG_CHECKING),TRUE)
Expand Down
4 changes: 2 additions & 2 deletions Tools/GNUMake/comps/hip.mak
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ endif # BL_NO_FORT
ifeq ($(HIP_COMPILER),clang)

ifeq ($(DEBUG),TRUE)
CXXFLAGS += -g -O0 #-ftrapv
CFLAGS += -g -O0 #-ftrapv
CXXFLAGS += -g -O1 -munsafe-fp-atomics
CFLAGS += -g -O0

FFLAGS += -g -O0 -ggdb -fbounds-check -fbacktrace -Wuninitialized -Wunused -ffpe-trap=invalid,zero -finit-real=snan -finit-integer=2147483647 -ftrapv
F90FLAGS += -g -O0 -ggdb -fbounds-check -fbacktrace -Wuninitialized -Wunused -ffpe-trap=invalid,zero -finit-real=snan -finit-integer=2147483647 -ftrapv
Expand Down

0 comments on commit 1a96800

Please sign in to comment.