[Bf-blender-cvs] [2484f3606ab] cycles_oneapi: Cycles: pass -g to sycl compiler for Debug/RelWithDebInfo configs

Xavier Hallade noreply at git.blender.org
Tue May 17 14:37:02 CEST 2022


Commit: 2484f3606aba4011b8259eda66110fce18df1fc5
Author: Xavier Hallade
Date:   Tue May 17 14:30:47 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB2484f3606aba4011b8259eda66110fce18df1fc5

Cycles: pass -g to sycl compiler for Debug/RelWithDebInfo configs

and add missing WITH_CYCLES_DEBUG define.

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

M	intern/cycles/kernel/CMakeLists.txt

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

diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index f4f0856aaf8..7e361bf5db1 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -734,6 +734,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
       ${ONEAPI_DPCPP_FLAGS}
       )
 
+
   if (WITH_CYCLES_ONEAPI_SYCL_HOST_ENABLED)
     list(APPEND sycl_compiler_flags -DWITH_ONEAPI_SYCL_HOST_ENABLED)
   endif()
@@ -756,6 +757,10 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
       -I"${NANOVDB_INCLUDE_DIR}")
   endif()
 
+  if(WITH_CYCLES_DEBUG)
+    list(APPEND sycl_compiler_flags -DWITH_CYCLES_DEBUG)
+  endif()
+
   get_filename_component(sycl_compiler_root ${SYCL_COMPILER} DIRECTORY)
   get_filename_component(sycl_compiler_compiler_name ${SYCL_COMPILER} NAME_WE)
 
@@ -786,7 +791,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
       add_custom_command(
         OUTPUT ${cycles_kernel_oneapi_lib}
         COMMAND "${sycl_compiler_root}/../../env/vars.bat"
-        COMMAND ${SYCL_COMPILER} ${sycl_compiler_flags}
+        COMMAND ${SYCL_COMPILER} $<$<CONFIG:Debug,RelWithDebInfo>:-g> ${sycl_compiler_flags}
         DEPENDS ${cycles_oneapi_kernel_sources})
     else()
       # The open source SYCL compiler just goes by clang++ and does not have such a script.
@@ -801,7 +806,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
         COMMAND ${CMAKE_COMMAND} -E env
                 "LIB=${sycl_compiler_root}/../lib"
                 "PATH=${sycl_compiler_root}/../lib/ocloc;${sycl_compiler_root};$ENV{PATH}"
-                ${SYCL_COMPILER} ${sycl_compiler_flags}
+                ${SYCL_COMPILER} $<$<CONFIG:Debug,RelWithDebInfo>:-g> ${sycl_compiler_flags}
         DEPENDS ${cycles_oneapi_kernel_sources})
     endif()
   else()
@@ -810,7 +815,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
     if(sycl_compiler_compiler_name MATCHES "dpcpp")
       add_custom_command(
         OUTPUT ${cycles_kernel_oneapi_lib}
-        COMMAND bash -c \"source ${sycl_compiler_root}/../../env/vars.sh&&${SYCL_COMPILER} ${sycl_compiler_flags}\"
+        COMMAND bash -c \"source ${sycl_compiler_root}/../../env/vars.sh&&${SYCL_COMPILER} $<$<CONFIG:Debug,RelWithDebInfo>:-g> ${sycl_compiler_flags}\"
         DEPENDS ${cycles_oneapi_kernel_sources})
     else()
       # The open source SYCL compiler just goes by clang++ and does not have such a script.
@@ -820,7 +825,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
         COMMAND ${CMAKE_COMMAND} -E env
                 "LD_LIBRARY_PATH=${sycl_compiler_root}/../lib:${sycl_compiler_root}/../lib/ocloc/lib64:${sycl_compiler_root}/../lib/ocloc/lib64/intel-opencl:${sycl_compiler_root}/../lib/igc/lib64:$ENV{LD_LIBRARY_PATH}"
                 "PATH=${sycl_compiler_root}/../lib/ocloc/bin:${sycl_compiler_root}:$ENV{PATH}"
-                ${SYCL_COMPILER} ${sycl_compiler_flags}
+                ${SYCL_COMPILER} $<$<CONFIG:Debug,RelWithDebInfo>:-g> ${sycl_compiler_flags}
         DEPENDS ${cycles_oneapi_kernel_sources})
     endif()
   endif()



More information about the Bf-blender-cvs mailing list