Skip to content

Commit

Permalink
Allow build-time USE_SIMD=... to take comma-separated list of options.
Browse files Browse the repository at this point in the history
This lets us make build-time mix-and-match of things like avx, f16c, fma, etc.,
rather than choosing just one level.
  • Loading branch information
lgritz committed Apr 10, 2015
1 parent 40b98e1 commit 2560058
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Expand Up @@ -196,11 +196,15 @@ if (NOT USE_SIMD STREQUAL "")
if (USE_SIMD STREQUAL "0")
add_definitions ("-DOIIO_NO_SSE=1")
else ()
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
add_definitions ("/arch:${USE_SIMD}")
else ()
add_definitions ("-m${USE_SIMD}")
endif ()
string (REPLACE "," ";" SIMD_FEATURE_LIST ${USE_SIMD})
foreach (feature ${SIMD_FEATURE_LIST})
message (STATUS "SIMD feature: ${feature}")
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
add_definitions ("/arch:${feature}")
else ()
add_definitions ("-m${feature}")
endif ()
endforeach()
endif ()
endif ()

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -395,6 +395,6 @@ help:
@echo " OIIO_BUILD_TESTS=0 Skip building the unit tests"
@echo " BUILD_OIIOUTIL_ONLY=1 Build *only* libOpenImageIO_Util"
@echo " USE_SIMD=arch Build with SIMD support (choices: 0, sse2, sse3,"
@echo " ssse3, sse4.1, sse4.2)"
@echo " ssse3, sse4.1, sse4.2, f16c, comma-separated ok)"
@echo ""

0 comments on commit 2560058

Please sign in to comment.