diff options
author | Milan Jaros <jar091> | 2018-04-02 17:11:11 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-02 17:39:04 +0300 |
commit | 888a04c7e4e6002ac7d757fdb6d443561de696dd (patch) | |
tree | 10116ab1ac475a60684dfe6eb0f6e06459b97717 /intern/cycles | |
parent | 692aeb6fe0e4314a17cf15c7252d2bfa21a1c9c6 (diff) |
Build: fixes for the Intel compiler versions 2016, 2017, 2018.
Differential Revision: https://developer.blender.org/D3109
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 48 | ||||
-rw-r--r-- | intern/cycles/util/util_types_float4.h | 1 | ||||
-rw-r--r-- | intern/cycles/util/util_types_float4_impl.h | 5 |
3 files changed, 48 insertions, 6 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 9df1e91e239..c3305ac3dd8 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -104,6 +104,54 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CYCLES_KERNEL_FLAGS}") +elseif(WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Intel") + check_cxx_compiler_flag(/QxSSE2 CXX_HAS_SSE) + check_cxx_compiler_flag(/arch:AVX CXX_HAS_AVX) + check_cxx_compiler_flag(/QxCORE-AVX2 CXX_HAS_AVX2) + + if(CXX_HAS_SSE) + set(CYCLES_SSE2_KERNEL_FLAGS "/QxSSE2") + set(CYCLES_SSE3_KERNEL_FLAGS "/QxSSSE3") + set(CYCLES_SSE41_KERNEL_FLAGS "/QxSSE4.1") + + if(CXX_HAS_AVX) + set(CYCLES_AVX_KERNEL_FLAGS "/arch:AVX") + endif() + + if(CXX_HAS_AVX2) + set(CYCLES_AVX2_KERNEL_FLAGS "/QxCORE-AVX2") + endif() + endif() +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + if(APPLE) + # ICC does not support SSE2 flag on MacOSX + check_cxx_compiler_flag(-xssse3 CXX_HAS_SSE) + else() + check_cxx_compiler_flag(-xsse2 CXX_HAS_SSE) + endif() + + check_cxx_compiler_flag(-xavx CXX_HAS_AVX) + check_cxx_compiler_flag(-xcore-avx2 CXX_HAS_AVX2) + + if(CXX_HAS_SSE) + if(APPLE) + # ICC does not support SSE2 flag on MacOSX + set(CYCLES_SSE2_KERNEL_FLAGS "-xssse3") + else() + set(CYCLES_SSE2_KERNEL_FLAGS "-xsse2") + endif() + + set(CYCLES_SSE3_KERNEL_FLAGS "-xssse3") + set(CYCLES_SSE41_KERNEL_FLAGS "-xsse4.1") + + if(CXX_HAS_AVX) + set(CYCLES_AVX_KERNEL_FLAGS "-xavx") + endif() + + if(CXX_HAS_AVX2) + set(CYCLES_AVX2_KERNEL_FLAGS "-xcore-avx2") + endif() + endif() endif() if(CXX_HAS_SSE) diff --git a/intern/cycles/util/util_types_float4.h b/intern/cycles/util/util_types_float4.h index a7d9abe1b95..154391f6881 100644 --- a/intern/cycles/util/util_types_float4.h +++ b/intern/cycles/util/util_types_float4.h @@ -34,7 +34,6 @@ struct ccl_try_align(16) float4 { }; __forceinline float4(); - __forceinline float4(const float4& a); __forceinline explicit float4(const __m128& a); __forceinline operator const __m128&(void) const; diff --git a/intern/cycles/util/util_types_float4_impl.h b/intern/cycles/util/util_types_float4_impl.h index ff3ec4d4ecf..09f45f47d38 100644 --- a/intern/cycles/util/util_types_float4_impl.h +++ b/intern/cycles/util/util_types_float4_impl.h @@ -33,11 +33,6 @@ __forceinline float4::float4() { } -__forceinline float4::float4(const float4& a) - : m128(a.m128) -{ -} - __forceinline float4::float4(const __m128& a) : m128(a) { |