Skip to content

Commit 0f5269e

Browse files
committed
Fix cppauto deduction to check all vectorisation levels, picking the best
1 parent 8973282 commit 0f5269e

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MadtRex/makefiles/cudacpp_driver.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif
5656

5757
#=== Redefine BACKEND if the current value is 'cppauto'
5858

59-
# Set the default BACKEND choice corresponding to 'cppauto' (the 'best' C++ vectorization available: eventually use native instead?)
59+
# Set the default BACKEND choice corresponding to 'cppauto' (the 'best' C++ vectorization available)
6060
ifeq ($(BACKEND),cppauto)
6161
ifeq ($(UNAME_P),ppc64le)
6262
override BACKEND = cppsse4
@@ -67,13 +67,17 @@ ifeq ($(BACKEND),cppauto)
6767
###$(warning Using BACKEND='$(BACKEND)' because host SIMD features cannot be read from /proc/cpuinfo)
6868
else ifeq ($(shell grep -m1 -c avx512vl /proc/cpuinfo)$(shell $(CXX) --version | grep ^clang),1)
6969
override BACKEND = cpp512y
70-
else
70+
else ifeq ($(shell grep -m1 -c avx2 /proc/cpuinfo),1)
7171
override BACKEND = cppavx2
7272
###ifneq ($(shell grep -m1 -c avx512vl /proc/cpuinfo),1)
7373
### $(warning Using BACKEND='$(BACKEND)' because host does not support avx512vl)
7474
###else
7575
### $(warning Using BACKEND='$(BACKEND)' because this is faster than avx512vl for clang)
7676
###endif
77+
else ifeq ($(shell grep -m1 -c sse4_2 /proc/cpuinfo),1)
78+
override BACKEND = cppsse4
79+
else
80+
override BACKEND = cppnone
7781
endif
7882
$(info BACKEND=$(BACKEND) (was cppauto))
7983
else

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MadtRex/makefiles/cudacpp_runner.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif
5656

5757
#=== Redefine BACKEND if the current value is 'cppauto'
5858

59-
# Set the default BACKEND choice corresponding to 'cppauto' (the 'best' C++ vectorization available: eventually use native instead?)
59+
# Set the default BACKEND choice corresponding to 'cppauto' (the 'best' C++ vectorization available)
6060
ifeq ($(BACKEND),cppauto)
6161
ifeq ($(UNAME_P),ppc64le)
6262
override BACKEND = cppsse4
@@ -67,13 +67,17 @@ ifeq ($(BACKEND),cppauto)
6767
###$(warning Using BACKEND='$(BACKEND)' because host SIMD features cannot be read from /proc/cpuinfo)
6868
else ifeq ($(shell grep -m1 -c avx512vl /proc/cpuinfo)$(shell $(CXX) --version | grep ^clang),1)
6969
override BACKEND = cpp512y
70-
else
70+
else ifeq ($(shell grep -m1 -c avx2 /proc/cpuinfo),1)
7171
override BACKEND = cppavx2
7272
###ifneq ($(shell grep -m1 -c avx512vl /proc/cpuinfo),1)
7373
### $(warning Using BACKEND='$(BACKEND)' because host does not support avx512vl)
7474
###else
7575
### $(warning Using BACKEND='$(BACKEND)' because this is faster than avx512vl for clang)
7676
###endif
77+
else ifeq ($(shell grep -m1 -c sse4_2 /proc/cpuinfo),1)
78+
override BACKEND = cppsse4
79+
else
80+
override BACKEND = cppnone
7781
endif
7882
$(info BACKEND=$(BACKEND) (was cppauto))
7983
else

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif
5656

5757
#=== Redefine BACKEND if the current value is 'cppauto'
5858

59-
# Set the default BACKEND choice corresponding to 'cppauto' (the 'best' C++ vectorization available: eventually use native instead?)
59+
# Set the default BACKEND choice corresponding to 'cppauto' (the 'best' C++ vectorization available)
6060
ifeq ($(BACKEND),cppauto)
6161
ifeq ($(UNAME_P),ppc64le)
6262
override BACKEND = cppsse4
@@ -67,13 +67,17 @@ ifeq ($(BACKEND),cppauto)
6767
###$(warning Using BACKEND='$(BACKEND)' because host SIMD features cannot be read from /proc/cpuinfo)
6868
else ifeq ($(shell grep -m1 -c avx512vl /proc/cpuinfo)$(shell $(CXX) --version | grep ^clang),1)
6969
override BACKEND = cpp512y
70-
else
70+
else ifeq ($(shell grep -m1 -c avx2 /proc/cpuinfo),1)
7171
override BACKEND = cppavx2
7272
###ifneq ($(shell grep -m1 -c avx512vl /proc/cpuinfo),1)
7373
### $(warning Using BACKEND='$(BACKEND)' because host does not support avx512vl)
7474
###else
7575
### $(warning Using BACKEND='$(BACKEND)' because this is faster than avx512vl for clang)
7676
###endif
77+
else ifeq ($(shell grep -m1 -c sse4_2 /proc/cpuinfo),1)
78+
override BACKEND = cppsse4
79+
else
80+
override BACKEND = cppnone
7781
endif
7882
$(info BACKEND=$(BACKEND) (was cppauto))
7983
else

0 commit comments

Comments
 (0)