forked from bartvdbraak/blender
Build: fixes for the Intel compiler versions 2016, 2017, 2018.
Differential Revision: https://developer.blender.org/D3109
This commit is contained in:
parent
692aeb6fe0
commit
888a04c7e4
@ -1496,8 +1496,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
|||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
|
||||||
|
|
||||||
# disable numbered, false positives
|
# disable numbered, false positives
|
||||||
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
|
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
|
||||||
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
|
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||||
# most msvc warnings are C & C++
|
# most msvc warnings are C & C++
|
||||||
set(_WARNINGS
|
set(_WARNINGS
|
||||||
|
@ -807,7 +807,7 @@ macro(TEST_SSE_SUPPORT
|
|||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
set(${_sse_flags} "") # icc defaults to -msse
|
set(${_sse_flags} "") # icc defaults to -msse
|
||||||
set(${_sse2_flags} "-msse2")
|
set(${_sse2_flags} "") # icc defaults to -msse2
|
||||||
else()
|
else()
|
||||||
message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known")
|
message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known")
|
||||||
set(${_sse_flags})
|
set(${_sse_flags})
|
||||||
|
@ -104,6 +104,54 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CYCLES_KERNEL_FLAGS}")
|
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()
|
endif()
|
||||||
|
|
||||||
if(CXX_HAS_SSE)
|
if(CXX_HAS_SSE)
|
||||||
|
@ -34,7 +34,6 @@ struct ccl_try_align(16) float4 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
__forceinline float4();
|
__forceinline float4();
|
||||||
__forceinline float4(const float4& a);
|
|
||||||
__forceinline explicit float4(const __m128& a);
|
__forceinline explicit float4(const __m128& a);
|
||||||
|
|
||||||
__forceinline operator const __m128&(void) const;
|
__forceinline operator const __m128&(void) const;
|
||||||
|
@ -33,11 +33,6 @@ __forceinline float4::float4()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
__forceinline float4::float4(const float4& a)
|
|
||||||
: m128(a.m128)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline float4::float4(const __m128& a)
|
__forceinline float4::float4(const __m128& a)
|
||||||
: m128(a)
|
: m128(a)
|
||||||
{
|
{
|
||||||
|
@ -297,7 +297,10 @@ bool BKE_displist_surfindex_get(DispList *dl, int a, int *b, int *p1, int *p2, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** make displists ********************* */
|
/* ****************** make displists ********************* */
|
||||||
|
#ifdef __INTEL_COMPILER
|
||||||
|
/* ICC with the optimization -02 causes crashes. */
|
||||||
|
# pragma intel optimization_level 1
|
||||||
|
#endif
|
||||||
static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase,
|
static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase,
|
||||||
const bool for_render, const bool use_render_resolution)
|
const bool for_render, const bool use_render_resolution)
|
||||||
{
|
{
|
||||||
|
@ -411,7 +411,7 @@ extern "C" {
|
|||||||
} (void)0
|
} (void)0
|
||||||
|
|
||||||
/* assuming a static array */
|
/* assuming a static array */
|
||||||
#if defined(__GNUC__) && !defined(__cplusplus) && !defined(__clang__)
|
#if defined(__GNUC__) && !defined(__cplusplus) && !defined(__clang__) && !defined(__INTEL_COMPILER)
|
||||||
# define ARRAY_SIZE(arr) \
|
# define ARRAY_SIZE(arr) \
|
||||||
((sizeof(struct {int isnt_array : ((const void *)&(arr) == &(arr)[0]);}) * 0) + \
|
((sizeof(struct {int isnt_array : ((const void *)&(arr) == &(arr)[0]);}) * 0) + \
|
||||||
(sizeof(arr) / sizeof(*(arr))))
|
(sizeof(arr) / sizeof(*(arr))))
|
||||||
|
Loading…
Reference in New Issue
Block a user