File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,17 @@ BENCHS = $(wildcard $(BENCHDIR)/*.cpp)
16
16
TESTOBJS = $(patsubst $(TESTDIR ) /% .cpp,$(TESTDIR ) /% .o,$(TESTS ) )
17
17
BENCHOBJS = $(patsubst $(BENCHDIR ) /% .cpp,$(BENCHDIR ) /% .o,$(BENCHS ) )
18
18
19
- # Compiling AVX512-FP16 instructions isn't possible for g++ < 12
20
- ifeq ($(shell expr `$(CXX ) -dumpversion | cut -d '.' -f 1` \< 12) , 1)
21
- MARCHFLAG = -march=icelake-client
22
- BENCHOBJS_SKIP += bench-qsortfp16.o
23
- TESTOBJS_SKIP += test-qsortfp16.o
19
+ test_cxx_flag = $(shell 2>/dev/null $(CXX ) -o /dev/null $(1 ) -c -x c++ /dev/null; echo $$? )
20
+
21
+ # Compiling AVX512-FP16 instructions wasn't possible until GCC 12
22
+ ifeq ($(call test_cxx_flag,-mavx512fp16) , 1)
23
+ BENCHOBJS_SKIP += bench-qsortfp16.o
24
+ TESTOBJS_SKIP += test-qsortfp16.o
25
+ endif
26
+
27
+ # Sapphire Rapids was otherwise supported from GCC 11. Downgrade if required.
28
+ ifeq ($(call test_cxx_flag,$(MARCHFLAG ) ) , 1)
29
+ MARCHFLAG = -march=icelake-client
24
30
endif
25
31
26
32
BENCHOBJS := $(filter-out $(addprefix $(BENCHDIR ) /, $(BENCHOBJS_SKIP ) ) ,$(BENCHOBJS ) )
You can’t perform that action at this time.
0 commit comments