[Bf-blender-cvs] [42c8b4fece7] cycles_oneapi: Build: refine CentOS7 IGC AoT workaround down to -fhonor-nans

Xavier Hallade noreply at git.blender.org
Thu Jun 2 10:25:31 CEST 2022


Commit: 42c8b4fece7fe0adc695c1d707ef52220689bcdf
Author: Xavier Hallade
Date:   Thu Jun 2 10:25:10 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB42c8b4fece7fe0adc695c1d707ef52220689bcdf

Build: refine CentOS7 IGC AoT workaround down to -fhonor-nans

===================================================================

M	intern/cycles/kernel/CMakeLists.txt

===================================================================

diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index bdfa9f2c747..b7652d3a0a5 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -725,6 +725,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
       -fdelayed-template-parsing
       -shared
       -DWITH_ONEAPI
+      -ffast-math
       -DNDEBUG
       -O2
       -o ${cycles_kernel_oneapi_lib}
@@ -800,11 +801,6 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
     endif()
   endif()
 
-  # avoid using -ffast-math for the graphics compiler on CentOS 7 until the compile-time issue it triggers gets fixed.
-  if(WIN32 OR NOT WITH_CYCLES_ONEAPI_BINARIES)
-    list(APPEND sycl_compiler_flags -ffast-math)
-  endif()
-
   if(WIN32)
     list(APPEND sycl_compiler_flags
     -fms-extensions
@@ -850,6 +846,11 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
   else()
     list(APPEND sycl_compiler_flags -fPIC)
 
+    # avoid getting __FAST_MATH__ to be defined for the graphics compiler on CentOS 7 until the compile-time issue it triggers gets fixed.
+    if(WITH_CYCLES_ONEAPI_BINARIES)
+      list(APPEND sycl_compiler_flags -fhonor-nans)
+    endif()
+
     # add $ORIGIN to cycles_kernel_oneapi.so rpath so libsycl.so and
     # libpi_level_zero.so can be placed next to it and get found.
     list(APPEND sycl_compiler_flags -Wl,-rpath,'$$ORIGIN')



More information about the Bf-blender-cvs mailing list