diff options
author | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-10 16:18:12 +0300 |
---|---|---|
committer | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-10 16:18:12 +0300 |
commit | 67474a7e622957044bc708119a7cfa49a82790fd (patch) | |
tree | 1689263da79f08b1c3c9725ac56c3da8b5d91fbb /intern | |
parent | b091542fe91353c15dd7240ba7ce8ecf72d4011b (diff) | |
parent | 553b581f25c1782c4231816965cd3f6ce58a449a (diff) |
Merge master to soc-2019-cycles-procedural.soc-2019-cycles-procedural
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 11 | ||||
-rw-r--r-- | intern/cycles/util/util_simd.h | 2 | ||||
-rw-r--r-- | intern/elbeem/CMakeLists.txt | 6 | ||||
-rw-r--r-- | intern/numaapi/source/numaapi_win32.c | 19 |
4 files changed, 28 insertions, 10 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 3fc92525821..8daa845f830 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -491,6 +491,17 @@ endif() include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) +if(CMAKE_COMPILER_IS_GNUCC AND (NOT WITH_CYCLES_KERNEL_ASAN)) + # GCC hangs compiling the big kernel files with asan and release, so disable by default. + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=all") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr") +elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") + # With OSL, Cycles disables rtti in some modules, wich then breaks at linking + # when trying to use vptr sanitizer (included into 'undefined' general option). + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=vptr") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr") +endif() + set_source_files_properties(kernels/cpu/kernel.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/kernel_split.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}") set_source_files_properties(kernels/cpu/filter.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}") diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h index 8fcaadc5f53..f49cfb4184d 100644 --- a/intern/cycles/util/util_simd.h +++ b/intern/cycles/util/util_simd.h @@ -45,7 +45,7 @@ # endif -# if defined(__x86_64__) || defined(__i386__) || defined(_M_X64) || defined(_M_IX86) +# if defined(__x86_64__) || defined(_M_X64) # define SIMD_SET_FLUSH_TO_ZERO \ _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); \ _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); diff --git a/intern/elbeem/CMakeLists.txt b/intern/elbeem/CMakeLists.txt index 926329be61b..383cfa66c15 100644 --- a/intern/elbeem/CMakeLists.txt +++ b/intern/elbeem/CMakeLists.txt @@ -119,4 +119,10 @@ else() add_definitions(-DPARALLEL=0) endif() +# Work around hang with GCC and ASAN. +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=vptr") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr") +endif() + blender_add_lib_nolist(bf_intern_elbeem "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/intern/numaapi/source/numaapi_win32.c b/intern/numaapi/source/numaapi_win32.c index bd370707656..f205968b6b4 100644 --- a/intern/numaapi/source/numaapi_win32.c +++ b/intern/numaapi/source/numaapi_win32.c @@ -193,22 +193,22 @@ bool numaAPI_IsNodeAvailable(int node) { // // This is needed because numaApiGetNumNodes() is not guaranteed to // give total amount of nodes and some nodes might be unavailable. - ULONGLONG processor_mask; - if (!_GetNumaNodeProcessorMask(node, &processor_mask)) { + GROUP_AFFINITY processor_mask = { 0 }; + if (!_GetNumaNodeProcessorMaskEx(node, &processor_mask)) { return false; } - if (processor_mask == 0) { + if (processor_mask.Mask == 0) { return false; } return true; } int numaAPI_GetNumNodeProcessors(int node) { - ULONGLONG processor_mask; - if (!_GetNumaNodeProcessorMask(node, &processor_mask)) { + GROUP_AFFINITY processor_mask = { 0 }; + if (!_GetNumaNodeProcessorMaskEx(node, &processor_mask)) { return 0; } - return countNumSetBits(processor_mask); + return countNumSetBits(processor_mask.Mask); } //////////////////////////////////////////////////////////////////////////////// @@ -239,11 +239,12 @@ bool numaAPI_RunProcessOnNode(int node) { // TODO(sergey): Make sure requested node is within active CPU group. // Change affinity of the proces to make it to run on a given node. HANDLE process_handle = GetCurrentProcess(); - ULONGLONG processor_mask; - if (_GetNumaNodeProcessorMask(node, &processor_mask) == 0) { + GROUP_AFFINITY processor_mask = { 0 }; + if (_GetNumaNodeProcessorMaskEx(node, &processor_mask) == 0) { return false; } - if (_SetProcessAffinityMask(process_handle, processor_mask) == 0) { + // TODO: Affinity should respect processor group. + if (_SetProcessAffinityMask(process_handle, processor_mask.Mask) == 0) { return false; } return true; |