From f021a8985209f0ea9f19015a1c670ed3bc910b32 Mon Sep 17 00:00:00 2001 From: Andrea Valassi Date: Fri, 20 Sep 2024 17:24:40 +0200 Subject: [PATCH] [helas] backport to CODEGEN the gg_tt.mad changes in cudacpp.mk to try and support HELINL=L on AMD GPUs via HIP (still incomplete) --- .../madgraph/iolibs/template_files/gpu/cudacpp.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/cudacpp.mk b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/cudacpp.mk index 238a37108..bb902e0f3 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/cudacpp.mk +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/cudacpp.mk @@ -795,8 +795,13 @@ endif ifeq ($(HELINL),L) cxx_objects_lib+=$(BUILDDIR)/HelAmps_cpp.o gpu_objects_lib+=$(BUILDDIR)/HelAmps_$(GPUSUFFIX).o +ifeq ($(findstring nvcc,$(GPUCC)),nvcc) # Nvidia GPU build $(BUILDDIR)/CPPProcess_$(GPUSUFFIX).o: GPUFLAGS += -rdc true # compilation fails if this is not added (ptxas fatal: Unresolved extern function) $(BUILDDIR)/HelAmps_$(GPUSUFFIX).o: GPUFLAGS += -rdc true # runtime fails if this is not added ('invalid device symbol' in CPPProcess.cc cHel to tHel copy) +else ifeq ($(findstring hipcc,$(GPUCC)),hipcc) # AMD GPU build +$(BUILDDIR)/CPPProcess_$(GPUSUFFIX).o: GPUFLAGS += -fgpu-rdc # compilation fails if this is not added (lld: error: undefined hidden symbol: mg5amcGpu::linker_CD_FFV1_0) +$(gpu_checkmain): LIBFLAGS += -fgpu-rdc --hip-link +endif endif # Target (and build rules): C++ and CUDA/HIP shared libraries