From 4ea567aee9a0c7b3c97cc306679e8f4a9808da32 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 30 Nov 2015 11:08:21 -0500 Subject: [PATCH] Remove VTKm_ENABLE_VECTORIZATION, as VTKm_Vectorization handles all use cases. --- CMake/UseVTKmSerial.cmake | 4 +-- CMake/UseVTKmTBB.cmake | 4 +-- CMake/VTKmCompilerOptimizations.cmake | 37 ++++++++++++--------------- CMake/VTKmConfig.cmake.in | 1 - CMakeLists.txt | 3 +-- 5 files changed, 20 insertions(+), 29 deletions(-) diff --git a/CMake/UseVTKmSerial.cmake b/CMake/UseVTKmSerial.cmake index d92a902e1..da48849f1 100644 --- a/CMake/UseVTKmSerial.cmake +++ b/CMake/UseVTKmSerial.cmake @@ -34,9 +34,7 @@ endif () #----------------------------------------------------------------------------- # Set up the compiler flag optimizations #----------------------------------------------------------------------------- -if(VTKm_ENABLE_VECTORIZATION) - include(VTKmCompilerOptimizations) -endif() +include(VTKmCompilerOptimizations) if (VTKm_Serial_FOUND) set(VTKm_Serial_initialize_complete TRUE) diff --git a/CMake/UseVTKmTBB.cmake b/CMake/UseVTKmTBB.cmake index b85371f31..70adb0672 100644 --- a/CMake/UseVTKmTBB.cmake +++ b/CMake/UseVTKmTBB.cmake @@ -47,9 +47,7 @@ endif () #----------------------------------------------------------------------------- # Set up the compiler flag optimizations #----------------------------------------------------------------------------- -if(VTKm_ENABLE_VECTORIZATION) - include(VTKmCompilerOptimizations) -endif() +include(VTKmCompilerOptimizations) #----------------------------------------------------------------------------- # Set up all these dependent packages (if they were all found). diff --git a/CMake/VTKmCompilerOptimizations.cmake b/CMake/VTKmCompilerOptimizations.cmake index cbb955743..c6d4879d0 100644 --- a/CMake/VTKmCompilerOptimizations.cmake +++ b/CMake/VTKmCompilerOptimizations.cmake @@ -116,28 +116,25 @@ endif() # we are going to require. # # -if(VTKm_ENABLE_VECTORIZATION) - set(flags) - if(VTKm_Vectorization STREQUAL "avx") - get_property(flags GLOBAL PROPERTY VTKm_AVX_FLAGS) - elseif(VTKm_Vectorization STREQUAL "avx2") - get_property(avx GLOBAL PROPERTY VTKm_AVX_FLAGS) - get_property(avx2 GLOBAL PROPERTY VTKm_AVX2_FLAGS) - set(flags ${avx} ${avx2}) - elseif(VTKm_Vectorization STREQUAL "avx512") - get_property(avx GLOBAL PROPERTY VTKm_AVX_FLAGS) - get_property(avx2 GLOBAL PROPERTY VTKm_AVX2_FLAGS) - get_property(avx512 GLOBAL PROPERTY VTKm_AVX512_FLAGS) - set(flags ${avx} ${avx2} ${avx512}) - endif() - - #have to specify each compile option separately, can't do them in bulk - foreach(flag ${flags}) - - add_compile_options( ${flag} ) - endforeach() +set(flags) +if(VTKm_Vectorization STREQUAL "avx") + get_property(flags GLOBAL PROPERTY VTKm_AVX_FLAGS) +elseif(VTKm_Vectorization STREQUAL "avx2") + get_property(avx GLOBAL PROPERTY VTKm_AVX_FLAGS) + get_property(avx2 GLOBAL PROPERTY VTKm_AVX2_FLAGS) + set(flags ${avx} ${avx2}) +elseif(VTKm_Vectorization STREQUAL "avx512") + get_property(avx GLOBAL PROPERTY VTKm_AVX_FLAGS) + get_property(avx2 GLOBAL PROPERTY VTKm_AVX2_FLAGS) + get_property(avx512 GLOBAL PROPERTY VTKm_AVX512_FLAGS) + set(flags ${avx} ${avx2} ${avx512}) endif() +#have to specify each compile option separately, can't do them in bulk +foreach(flag ${flags}) + add_compile_options( ${flag} ) +endforeach() + # # Lastly we need to setup flags that can be configured into a vtk-m header # file. so that the code understands that we have enabled vectorization diff --git a/CMake/VTKmConfig.cmake.in b/CMake/VTKmConfig.cmake.in index fcec91c38..1e871e5ea 100644 --- a/CMake/VTKmConfig.cmake.in +++ b/CMake/VTKmConfig.cmake.in @@ -43,7 +43,6 @@ set(VTKm_CMAKE_MODULE_PATH "@VTKm_CMAKE_MODULE_PATH_CONFIG@") set(VTKm_ENABLE_CUDA "@VTKm_ENABLE_CUDA@") set(VTKm_ENABLE_TBB "@VTKm_ENABLE_TBB@") -set(VTKm_ENABLE_VECTORIZATION "@VTKm_ENABLE_VECTORIZATION@") # VTKm requires some CMake Find modules not included with CMake, so # include the CMake modules distributed with VTKm. diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a3f89064..b9d7ae605 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,7 +92,6 @@ include(CMake/VTKmCompilerExtras.cmake) # Configurable Options option(VTKm_ENABLE_CUDA "Enable Cuda support" OFF) option(VTKm_ENABLE_TBB "Enable TBB support" OFF) -option(VTKm_ENABLE_VECTORIZATION "Enable compiler vectorization support" ON) option(VTKm_ENABLE_TESTING "Enable VTKm Testing" ON) option(VTKm_ENABLE_BENCHMARKS "Enable VTKm Benchmarking" OFF) @@ -233,7 +232,7 @@ set(VTKM_USE_64BIT_IDS ${VTKm_USE_64BIT_IDS}) set(VTKM_ENABLE_CUDA ${VTKm_ENABLE_CUDA}) set(VTKM_ENABLE_TBB ${VTKm_ENABLE_TBB}) -set(VTKM_ENABLE_VECTORIZATION ${VTKm_ENABLE_VECTORIZATION}) +set(VTKM_ENABLE_VECTORIZATION ON) if(VTKm_Vectorization STREQUAL "none") set(VTKM_ENABLE_VECTORIZATION OFF) endif()