Skip to content

Commit 9b394e6

Browse files
committed
Merge remote-tracking branch 'upstream/master' (with hel madgraph5#960, mac madgraph5#974, nvcc madgraph5#966) into prof
2 parents 95329f3 + 3f69b26 commit 9b394e6

File tree

24 files changed

+691
-208
lines changed

24 files changed

+691
-208
lines changed

.github/workflows/c-cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
CPU_MAC:
3939
runs-on: macos-latest
4040
env:
41-
FC: gfortran-11
41+
FC: gfortran-14 # see #971
4242
strategy:
4343
matrix:
4444
folder: [ epochX/cudacpp/ee_mumu.mad/SubProcesses/P1_epem_mupmum, epochX/cudacpp/gg_ttgg.mad/SubProcesses/P1_gg_ttxgg ]

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/cudacpp.mk

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,31 @@ override CUDA_HOME = $(patsubst %%/bin/nvcc,%%,$(shell which nvcc 2>/dev/null))
116116
# Set HIP_HOME from the path to hipcc, if it exists
117117
override HIP_HOME = $(patsubst %%/bin/hipcc,%%,$(shell which hipcc 2>/dev/null))
118118

119-
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists
120-
# (FIXME? Is there any equivalent of NVTX FOR HIP? What should be configured if both CUDA and HIP are installed?)
121-
ifneq ($(CUDA_HOME),)
122-
USE_NVTX ?=-DUSE_NVTX
123-
CUDA_INC = -I$(CUDA_HOME)/include/
119+
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists (see #965)
120+
ifeq ($(CUDA_HOME),)
121+
# CUDA_HOME is empty (nvcc not found)
122+
override CUDA_INC=
123+
else ifeq ($(wildcard $(CUDA_HOME)/include/),)
124+
# CUDA_HOME is defined (nvcc was found) but $(CUDA_HOME)/include/ does not exist?
125+
override CUDA_INC=
124126
else
127+
CUDA_INC = -I$(CUDA_HOME)/include/
128+
endif
129+
###$(info CUDA_INC=$(CUDA_INC))
130+
131+
# Configure NVTX if a CUDA include directory exists and NVTX headers exist (see #965)
132+
ifeq ($(CUDA_INC),)
133+
# $(CUDA_HOME)/include/ does not exist
125134
override USE_NVTX=
126-
override CUDA_INC=
135+
else ifeq ($(wildcard $(CUDA_HOME)/include/nvtx3/nvToolsExt.h),)
136+
# $(CUDA_HOME)/include/ exists but NVTX headers do not exist?
137+
override USE_NVTX=
138+
else
139+
# $(CUDA_HOME)/include/nvtx.h exists: use NVTX
140+
# (NB: the option to disable NVTX if 'USE_NVTX=' is defined has been removed)
141+
override USE_NVTX=-DUSE_NVTX
127142
endif
143+
###$(info USE_NVTX=$(USE_NVTX))
128144

129145
# NB: NEW LOGIC FOR ENABLING AND DISABLING CUDA OR HIP BUILDS (AV Feb-Mar 2024)
130146
# - In the old implementation, by default the C++ targets for one specific AVX were always built together with either CUDA or HIP.
@@ -424,13 +440,18 @@ endif
424440
# (NB: allow HASCURAND=hasCurand even if $(GPUCC) does not point to nvcc: assume CUDA_HOME was defined correctly...)
425441
ifeq ($(HASCURAND),)
426442
ifeq ($(GPUCC),) # CPU-only build
427-
ifneq ($(CUDA_HOME),)
443+
ifeq ($(CUDA_INC),)
444+
# $(CUDA_HOME)/include/ does not exist (see #965)
445+
override HASCURAND = hasNoCurand
446+
else ifeq ($(wildcard $(CUDA_HOME)/include/curand.h),)
447+
# $(CUDA_HOME)/include/ exists but CURAND headers do not exist? (see #965)
448+
override HASCURAND = hasNoCurand
449+
else
428450
# By default, assume that curand is installed if a CUDA installation exists
429451
override HASCURAND = hasCurand
430-
else
431-
override HASCURAND = hasNoCurand
432452
endif
433453
else ifeq ($(findstring nvcc,$(GPUCC)),nvcc) # Nvidia GPU build
454+
# By default, assume that curand is installed if a CUDA build is requested
434455
override HASCURAND = hasCurand
435456
else # non-Nvidia GPU build
436457
override HASCURAND = hasNoCurand

epochX/cudacpp/ee_mumu.mad/SubProcesses/cudacpp.mk

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,31 @@ override CUDA_HOME = $(patsubst %/bin/nvcc,%,$(shell which nvcc 2>/dev/null))
116116
# Set HIP_HOME from the path to hipcc, if it exists
117117
override HIP_HOME = $(patsubst %/bin/hipcc,%,$(shell which hipcc 2>/dev/null))
118118

119-
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists
120-
# (FIXME? Is there any equivalent of NVTX FOR HIP? What should be configured if both CUDA and HIP are installed?)
121-
ifneq ($(CUDA_HOME),)
122-
USE_NVTX ?=-DUSE_NVTX
123-
CUDA_INC = -I$(CUDA_HOME)/include/
119+
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists (see #965)
120+
ifeq ($(CUDA_HOME),)
121+
# CUDA_HOME is empty (nvcc not found)
122+
override CUDA_INC=
123+
else ifeq ($(wildcard $(CUDA_HOME)/include/),)
124+
# CUDA_HOME is defined (nvcc was found) but $(CUDA_HOME)/include/ does not exist?
125+
override CUDA_INC=
124126
else
127+
CUDA_INC = -I$(CUDA_HOME)/include/
128+
endif
129+
###$(info CUDA_INC=$(CUDA_INC))
130+
131+
# Configure NVTX if a CUDA include directory exists and NVTX headers exist (see #965)
132+
ifeq ($(CUDA_INC),)
133+
# $(CUDA_HOME)/include/ does not exist
125134
override USE_NVTX=
126-
override CUDA_INC=
135+
else ifeq ($(wildcard $(CUDA_HOME)/include/nvtx3/nvToolsExt.h),)
136+
# $(CUDA_HOME)/include/ exists but NVTX headers do not exist?
137+
override USE_NVTX=
138+
else
139+
# $(CUDA_HOME)/include/nvtx.h exists: use NVTX
140+
# (NB: the option to disable NVTX if 'USE_NVTX=' is defined has been removed)
141+
override USE_NVTX=-DUSE_NVTX
127142
endif
143+
###$(info USE_NVTX=$(USE_NVTX))
128144

129145
# NB: NEW LOGIC FOR ENABLING AND DISABLING CUDA OR HIP BUILDS (AV Feb-Mar 2024)
130146
# - In the old implementation, by default the C++ targets for one specific AVX were always built together with either CUDA or HIP.
@@ -424,13 +440,18 @@ endif
424440
# (NB: allow HASCURAND=hasCurand even if $(GPUCC) does not point to nvcc: assume CUDA_HOME was defined correctly...)
425441
ifeq ($(HASCURAND),)
426442
ifeq ($(GPUCC),) # CPU-only build
427-
ifneq ($(CUDA_HOME),)
443+
ifeq ($(CUDA_INC),)
444+
# $(CUDA_HOME)/include/ does not exist (see #965)
445+
override HASCURAND = hasNoCurand
446+
else ifeq ($(wildcard $(CUDA_HOME)/include/curand.h),)
447+
# $(CUDA_HOME)/include/ exists but CURAND headers do not exist? (see #965)
448+
override HASCURAND = hasNoCurand
449+
else
428450
# By default, assume that curand is installed if a CUDA installation exists
429451
override HASCURAND = hasCurand
430-
else
431-
override HASCURAND = hasNoCurand
432452
endif
433453
else ifeq ($(findstring nvcc,$(GPUCC)),nvcc) # Nvidia GPU build
454+
# By default, assume that curand is installed if a CUDA build is requested
434455
override HASCURAND = hasCurand
435456
else # non-Nvidia GPU build
436457
override HASCURAND = hasNoCurand

epochX/cudacpp/ee_mumu.sa/SubProcesses/cudacpp.mk

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,31 @@ override CUDA_HOME = $(patsubst %/bin/nvcc,%,$(shell which nvcc 2>/dev/null))
116116
# Set HIP_HOME from the path to hipcc, if it exists
117117
override HIP_HOME = $(patsubst %/bin/hipcc,%,$(shell which hipcc 2>/dev/null))
118118

119-
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists
120-
# (FIXME? Is there any equivalent of NVTX FOR HIP? What should be configured if both CUDA and HIP are installed?)
121-
ifneq ($(CUDA_HOME),)
122-
USE_NVTX ?=-DUSE_NVTX
123-
CUDA_INC = -I$(CUDA_HOME)/include/
119+
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists (see #965)
120+
ifeq ($(CUDA_HOME),)
121+
# CUDA_HOME is empty (nvcc not found)
122+
override CUDA_INC=
123+
else ifeq ($(wildcard $(CUDA_HOME)/include/),)
124+
# CUDA_HOME is defined (nvcc was found) but $(CUDA_HOME)/include/ does not exist?
125+
override CUDA_INC=
124126
else
127+
CUDA_INC = -I$(CUDA_HOME)/include/
128+
endif
129+
###$(info CUDA_INC=$(CUDA_INC))
130+
131+
# Configure NVTX if a CUDA include directory exists and NVTX headers exist (see #965)
132+
ifeq ($(CUDA_INC),)
133+
# $(CUDA_HOME)/include/ does not exist
125134
override USE_NVTX=
126-
override CUDA_INC=
135+
else ifeq ($(wildcard $(CUDA_HOME)/include/nvtx3/nvToolsExt.h),)
136+
# $(CUDA_HOME)/include/ exists but NVTX headers do not exist?
137+
override USE_NVTX=
138+
else
139+
# $(CUDA_HOME)/include/nvtx.h exists: use NVTX
140+
# (NB: the option to disable NVTX if 'USE_NVTX=' is defined has been removed)
141+
override USE_NVTX=-DUSE_NVTX
127142
endif
143+
###$(info USE_NVTX=$(USE_NVTX))
128144

129145
# NB: NEW LOGIC FOR ENABLING AND DISABLING CUDA OR HIP BUILDS (AV Feb-Mar 2024)
130146
# - In the old implementation, by default the C++ targets for one specific AVX were always built together with either CUDA or HIP.
@@ -424,13 +440,18 @@ endif
424440
# (NB: allow HASCURAND=hasCurand even if $(GPUCC) does not point to nvcc: assume CUDA_HOME was defined correctly...)
425441
ifeq ($(HASCURAND),)
426442
ifeq ($(GPUCC),) # CPU-only build
427-
ifneq ($(CUDA_HOME),)
443+
ifeq ($(CUDA_INC),)
444+
# $(CUDA_HOME)/include/ does not exist (see #965)
445+
override HASCURAND = hasNoCurand
446+
else ifeq ($(wildcard $(CUDA_HOME)/include/curand.h),)
447+
# $(CUDA_HOME)/include/ exists but CURAND headers do not exist? (see #965)
448+
override HASCURAND = hasNoCurand
449+
else
428450
# By default, assume that curand is installed if a CUDA installation exists
429451
override HASCURAND = hasCurand
430-
else
431-
override HASCURAND = hasNoCurand
432452
endif
433453
else ifeq ($(findstring nvcc,$(GPUCC)),nvcc) # Nvidia GPU build
454+
# By default, assume that curand is installed if a CUDA build is requested
434455
override HASCURAND = hasCurand
435456
else # non-Nvidia GPU build
436457
override HASCURAND = hasNoCurand

epochX/cudacpp/gg_tt.mad/SubProcesses/cudacpp.mk

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,31 @@ override CUDA_HOME = $(patsubst %/bin/nvcc,%,$(shell which nvcc 2>/dev/null))
116116
# Set HIP_HOME from the path to hipcc, if it exists
117117
override HIP_HOME = $(patsubst %/bin/hipcc,%,$(shell which hipcc 2>/dev/null))
118118

119-
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists
120-
# (FIXME? Is there any equivalent of NVTX FOR HIP? What should be configured if both CUDA and HIP are installed?)
121-
ifneq ($(CUDA_HOME),)
122-
USE_NVTX ?=-DUSE_NVTX
123-
CUDA_INC = -I$(CUDA_HOME)/include/
119+
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists (see #965)
120+
ifeq ($(CUDA_HOME),)
121+
# CUDA_HOME is empty (nvcc not found)
122+
override CUDA_INC=
123+
else ifeq ($(wildcard $(CUDA_HOME)/include/),)
124+
# CUDA_HOME is defined (nvcc was found) but $(CUDA_HOME)/include/ does not exist?
125+
override CUDA_INC=
124126
else
127+
CUDA_INC = -I$(CUDA_HOME)/include/
128+
endif
129+
###$(info CUDA_INC=$(CUDA_INC))
130+
131+
# Configure NVTX if a CUDA include directory exists and NVTX headers exist (see #965)
132+
ifeq ($(CUDA_INC),)
133+
# $(CUDA_HOME)/include/ does not exist
125134
override USE_NVTX=
126-
override CUDA_INC=
135+
else ifeq ($(wildcard $(CUDA_HOME)/include/nvtx3/nvToolsExt.h),)
136+
# $(CUDA_HOME)/include/ exists but NVTX headers do not exist?
137+
override USE_NVTX=
138+
else
139+
# $(CUDA_HOME)/include/nvtx.h exists: use NVTX
140+
# (NB: the option to disable NVTX if 'USE_NVTX=' is defined has been removed)
141+
override USE_NVTX=-DUSE_NVTX
127142
endif
143+
###$(info USE_NVTX=$(USE_NVTX))
128144

129145
# NB: NEW LOGIC FOR ENABLING AND DISABLING CUDA OR HIP BUILDS (AV Feb-Mar 2024)
130146
# - In the old implementation, by default the C++ targets for one specific AVX were always built together with either CUDA or HIP.
@@ -424,13 +440,18 @@ endif
424440
# (NB: allow HASCURAND=hasCurand even if $(GPUCC) does not point to nvcc: assume CUDA_HOME was defined correctly...)
425441
ifeq ($(HASCURAND),)
426442
ifeq ($(GPUCC),) # CPU-only build
427-
ifneq ($(CUDA_HOME),)
443+
ifeq ($(CUDA_INC),)
444+
# $(CUDA_HOME)/include/ does not exist (see #965)
445+
override HASCURAND = hasNoCurand
446+
else ifeq ($(wildcard $(CUDA_HOME)/include/curand.h),)
447+
# $(CUDA_HOME)/include/ exists but CURAND headers do not exist? (see #965)
448+
override HASCURAND = hasNoCurand
449+
else
428450
# By default, assume that curand is installed if a CUDA installation exists
429451
override HASCURAND = hasCurand
430-
else
431-
override HASCURAND = hasNoCurand
432452
endif
433453
else ifeq ($(findstring nvcc,$(GPUCC)),nvcc) # Nvidia GPU build
454+
# By default, assume that curand is installed if a CUDA build is requested
434455
override HASCURAND = hasCurand
435456
else # non-Nvidia GPU build
436457
override HASCURAND = hasNoCurand

epochX/cudacpp/gg_tt.sa/SubProcesses/cudacpp.mk

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,31 @@ override CUDA_HOME = $(patsubst %/bin/nvcc,%,$(shell which nvcc 2>/dev/null))
116116
# Set HIP_HOME from the path to hipcc, if it exists
117117
override HIP_HOME = $(patsubst %/bin/hipcc,%,$(shell which hipcc 2>/dev/null))
118118

119-
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists
120-
# (FIXME? Is there any equivalent of NVTX FOR HIP? What should be configured if both CUDA and HIP are installed?)
121-
ifneq ($(CUDA_HOME),)
122-
USE_NVTX ?=-DUSE_NVTX
123-
CUDA_INC = -I$(CUDA_HOME)/include/
119+
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists (see #965)
120+
ifeq ($(CUDA_HOME),)
121+
# CUDA_HOME is empty (nvcc not found)
122+
override CUDA_INC=
123+
else ifeq ($(wildcard $(CUDA_HOME)/include/),)
124+
# CUDA_HOME is defined (nvcc was found) but $(CUDA_HOME)/include/ does not exist?
125+
override CUDA_INC=
124126
else
127+
CUDA_INC = -I$(CUDA_HOME)/include/
128+
endif
129+
###$(info CUDA_INC=$(CUDA_INC))
130+
131+
# Configure NVTX if a CUDA include directory exists and NVTX headers exist (see #965)
132+
ifeq ($(CUDA_INC),)
133+
# $(CUDA_HOME)/include/ does not exist
125134
override USE_NVTX=
126-
override CUDA_INC=
135+
else ifeq ($(wildcard $(CUDA_HOME)/include/nvtx3/nvToolsExt.h),)
136+
# $(CUDA_HOME)/include/ exists but NVTX headers do not exist?
137+
override USE_NVTX=
138+
else
139+
# $(CUDA_HOME)/include/nvtx.h exists: use NVTX
140+
# (NB: the option to disable NVTX if 'USE_NVTX=' is defined has been removed)
141+
override USE_NVTX=-DUSE_NVTX
127142
endif
143+
###$(info USE_NVTX=$(USE_NVTX))
128144

129145
# NB: NEW LOGIC FOR ENABLING AND DISABLING CUDA OR HIP BUILDS (AV Feb-Mar 2024)
130146
# - In the old implementation, by default the C++ targets for one specific AVX were always built together with either CUDA or HIP.
@@ -424,13 +440,18 @@ endif
424440
# (NB: allow HASCURAND=hasCurand even if $(GPUCC) does not point to nvcc: assume CUDA_HOME was defined correctly...)
425441
ifeq ($(HASCURAND),)
426442
ifeq ($(GPUCC),) # CPU-only build
427-
ifneq ($(CUDA_HOME),)
443+
ifeq ($(CUDA_INC),)
444+
# $(CUDA_HOME)/include/ does not exist (see #965)
445+
override HASCURAND = hasNoCurand
446+
else ifeq ($(wildcard $(CUDA_HOME)/include/curand.h),)
447+
# $(CUDA_HOME)/include/ exists but CURAND headers do not exist? (see #965)
448+
override HASCURAND = hasNoCurand
449+
else
428450
# By default, assume that curand is installed if a CUDA installation exists
429451
override HASCURAND = hasCurand
430-
else
431-
override HASCURAND = hasNoCurand
432452
endif
433453
else ifeq ($(findstring nvcc,$(GPUCC)),nvcc) # Nvidia GPU build
454+
# By default, assume that curand is installed if a CUDA build is requested
434455
override HASCURAND = hasCurand
435456
else # non-Nvidia GPU build
436457
override HASCURAND = hasNoCurand

epochX/cudacpp/gg_tt01g.mad/SubProcesses/cudacpp.mk

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,31 @@ override CUDA_HOME = $(patsubst %/bin/nvcc,%,$(shell which nvcc 2>/dev/null))
116116
# Set HIP_HOME from the path to hipcc, if it exists
117117
override HIP_HOME = $(patsubst %/bin/hipcc,%,$(shell which hipcc 2>/dev/null))
118118

119-
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists
120-
# (FIXME? Is there any equivalent of NVTX FOR HIP? What should be configured if both CUDA and HIP are installed?)
121-
ifneq ($(CUDA_HOME),)
122-
USE_NVTX ?=-DUSE_NVTX
123-
CUDA_INC = -I$(CUDA_HOME)/include/
119+
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists (see #965)
120+
ifeq ($(CUDA_HOME),)
121+
# CUDA_HOME is empty (nvcc not found)
122+
override CUDA_INC=
123+
else ifeq ($(wildcard $(CUDA_HOME)/include/),)
124+
# CUDA_HOME is defined (nvcc was found) but $(CUDA_HOME)/include/ does not exist?
125+
override CUDA_INC=
124126
else
127+
CUDA_INC = -I$(CUDA_HOME)/include/
128+
endif
129+
###$(info CUDA_INC=$(CUDA_INC))
130+
131+
# Configure NVTX if a CUDA include directory exists and NVTX headers exist (see #965)
132+
ifeq ($(CUDA_INC),)
133+
# $(CUDA_HOME)/include/ does not exist
125134
override USE_NVTX=
126-
override CUDA_INC=
135+
else ifeq ($(wildcard $(CUDA_HOME)/include/nvtx3/nvToolsExt.h),)
136+
# $(CUDA_HOME)/include/ exists but NVTX headers do not exist?
137+
override USE_NVTX=
138+
else
139+
# $(CUDA_HOME)/include/nvtx.h exists: use NVTX
140+
# (NB: the option to disable NVTX if 'USE_NVTX=' is defined has been removed)
141+
override USE_NVTX=-DUSE_NVTX
127142
endif
143+
###$(info USE_NVTX=$(USE_NVTX))
128144

129145
# NB: NEW LOGIC FOR ENABLING AND DISABLING CUDA OR HIP BUILDS (AV Feb-Mar 2024)
130146
# - In the old implementation, by default the C++ targets for one specific AVX were always built together with either CUDA or HIP.
@@ -424,13 +440,18 @@ endif
424440
# (NB: allow HASCURAND=hasCurand even if $(GPUCC) does not point to nvcc: assume CUDA_HOME was defined correctly...)
425441
ifeq ($(HASCURAND),)
426442
ifeq ($(GPUCC),) # CPU-only build
427-
ifneq ($(CUDA_HOME),)
443+
ifeq ($(CUDA_INC),)
444+
# $(CUDA_HOME)/include/ does not exist (see #965)
445+
override HASCURAND = hasNoCurand
446+
else ifeq ($(wildcard $(CUDA_HOME)/include/curand.h),)
447+
# $(CUDA_HOME)/include/ exists but CURAND headers do not exist? (see #965)
448+
override HASCURAND = hasNoCurand
449+
else
428450
# By default, assume that curand is installed if a CUDA installation exists
429451
override HASCURAND = hasCurand
430-
else
431-
override HASCURAND = hasNoCurand
432452
endif
433453
else ifeq ($(findstring nvcc,$(GPUCC)),nvcc) # Nvidia GPU build
454+
# By default, assume that curand is installed if a CUDA build is requested
434455
override HASCURAND = hasCurand
435456
else # non-Nvidia GPU build
436457
override HASCURAND = hasNoCurand

0 commit comments

Comments
 (0)