File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,17 @@ set(BENCHMARKS_ISPC_FLAGS "-O3 --woff" CACHE STRING "Flags to pass to ISPC compi
7979message (STATUS "Using BENCHMARKS_ISPC_TARGETS: ${BENCHMARKS_ISPC_TARGETS} " )
8080message (STATUS "Using BENCHMARKS_ISPC_FLAGS: ${BENCHMARKS_ISPC_FLAGS} " )
8181
82+ # Warn if incompatible targets are used (SSE or AVX1)
83+ # The C++ portion of benchmarks is compiled with -mavx2 which generates AVX2 instructions
84+ # that are not available on SSE or AVX1 targets
85+ if (X86_HOST)
86+ string (TOLOWER "${BENCHMARKS_ISPC_TARGETS} " TARGETS_LOWER)
87+ if (TARGETS_LOWER MATCHES "sse[0-9]*" OR TARGETS_LOWER MATCHES "avx1" )
88+ message (WARNING "The C++ portion of benchmarks is compiled with -mavx2 which may produce illegal instructions for SSE or AVX1 targets.\n "
89+ "BENCHMARKS_ISPC_TARGETS contains: ${BENCHMARKS_ISPC_TARGETS} \n " )
90+ endif ()
91+ endif ()
92+
8293include (cmake/AddBenchmark.cmake)
8394
8495add_subdirectory (01_trivial)
You can’t perform that action at this time.
0 commit comments