Skip to content

Commit

Permalink
[amd] in gg_tt.mad cudacpp.mk, try to work around the HIP crashes mad…
Browse files Browse the repository at this point in the history
…graph5#1003 by disabling SIMD in C++ objects for HIP builds - it does not help, will revert
  • Loading branch information
valassi authored and zeniheisser committed Sep 23, 2024
1 parent cf602a1 commit 47a15ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions epochX/cudacpp/gg_tt.mad/SubProcesses/cudacpp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ CXXFLAGS += $(OMPFLAGS)
# [NB MGONGPU_PVW512 is needed because "-mprefer-vector-width=256" is not exposed in a macro]
# [See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96476]
ifeq ($(UNAME_P),ppc64le)
override AVXFLAGSNONE = # no SIMD
ifeq ($(BACKEND),cppsse4)
override AVXFLAGS = -D__SSE4_2__ # Power9 VSX with 128 width (VSR registers)
else ifeq ($(BACKEND),cppavx2)
Expand All @@ -493,6 +494,7 @@ ifeq ($(UNAME_P),ppc64le)
$(error Invalid SIMD BACKEND='$(BACKEND)': only 'cppnone' and 'cppsse4' are supported on PowerPC for the moment)
endif
else ifeq ($(UNAME_P),arm)
override AVXFLAGSNONE = # no SIMD
ifeq ($(BACKEND),cppsse4)
override AVXFLAGS = -D__SSE4_2__ # ARM NEON with 128 width (Q/quadword registers)
else ifeq ($(BACKEND),cppavx2)
Expand All @@ -503,6 +505,7 @@ else ifeq ($(UNAME_P),arm)
$(error Invalid SIMD BACKEND='$(BACKEND)': only 'cppnone' and 'cppsse4' are supported on ARM for the moment)
endif
else ifneq ($(shell $(CXX) --version | grep ^nvc++),) # support nvc++ #531
override AVXFLAGSNONE = -mno-sse3 # no SIMD
ifeq ($(BACKEND),cppnone)
override AVXFLAGS = -mno-sse3 # no SIMD
else ifeq ($(BACKEND),cppsse4)
Expand All @@ -515,6 +518,7 @@ else ifneq ($(shell $(CXX) --version | grep ^nvc++),) # support nvc++ #531
override AVXFLAGS = -march=skylake -DMGONGPU_PVW512 # AVX512 with 512 width (zmm registers)
endif
else
override AVXFLAGSNONE = -march=x86-64 # no SIMD (see #588)
ifeq ($(BACKEND),cppnone)
override AVXFLAGS = -march=x86-64 # no SIMD (see #588)
else ifeq ($(BACKEND),cppsse4)
Expand All @@ -528,8 +532,11 @@ else
endif
endif
# For the moment, use AVXFLAGS everywhere (in C++ builds): eventually, use them only in encapsulated implementations?
# Explicitly disable SIMD in the C++ libraries used with CUDA or HIP (work around for HIP crashes #1003)
ifeq ($(GPUCC),)
CXXFLAGS+= $(AVXFLAGS)
else
CXXFLAGS+= $(AVXFLAGSNONE)
endif

# Set the build flags appropriate to each FPTYPE choice (example: "make FPTYPE=f")
Expand Down

0 comments on commit 47a15ab

Please sign in to comment.