Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-08-24 16:39:52 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-08-24 16:39:52 +0300
commit61896947d4b75829d4275043e1554bd5eb4d8abb (patch)
tree77e0404335aaece7f195f45238419a09fc0dd508
parentbe0a68f0d10af97a22972d4d415076aef3b45b57 (diff)
parente65f0337e94242baf868aa2cd90a0b489e38b087 (diff)
Merge branch 'blender-v3.3-release'
-rw-r--r--build_files/cmake/config/blender_release.cmake2
-rw-r--r--intern/cycles/cmake/external_libs.cmake20
-rw-r--r--intern/cycles/kernel/CMakeLists.txt8
3 files changed, 18 insertions, 12 deletions
diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake
index a7a155a1d41..793d1cb0853 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -87,5 +87,5 @@ if(NOT APPLE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_HIP_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_ONEAPI ON CACHE BOOL "" FORCE)
- set(WITH_CYCLES_ONEAPI_BINARIES OM CACHE BOOL "" FORCE)
+ set(WITH_CYCLES_ONEAPI_BINARIES ON CACHE BOOL "" FORCE)
endif()
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index af2f280ae84..aaeb85f700d 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -628,15 +628,29 @@ endif()
# oneAPI
###########################################################################
-if (WITH_CYCLES_DEVICE_ONEAPI)
+if(WITH_CYCLES_DEVICE_ONEAPI)
find_package(SYCL)
find_package(LevelZero)
- if (SYCL_FOUND AND LEVEL_ZERO_FOUND)
+ if(SYCL_FOUND AND LEVEL_ZERO_FOUND)
message(STATUS "Found oneAPI: ${SYCL_LIBRARY}")
message(STATUS "Found Level Zero: ${LEVEL_ZERO_LIBRARY}")
+
+ if(WITH_CYCLES_ONEAPI_BINARIES)
+ if(NOT OCLOC_INSTALL_DIR)
+ get_filename_component(_sycl_compiler_root ${SYCL_COMPILER} DIRECTORY)
+ get_filename_component(OCLOC_INSTALL_DIR "${_sycl_compiler_root}/../lib/ocloc" ABSOLUTE)
+ unset(_sycl_compiler_root)
+ endif()
+
+ if(NOT EXISTS ${OCLOC_INSTALL_DIR})
+ message(STATUS "oneAPI ocloc not found in ${OCLOC_INSTALL_DIR}, disabling WITH_CYCLES_ONEAPI_BINARIES."
+ " A different ocloc directory can be set using OCLOC_INSTALL_DIR cmake variable.")
+ set(WITH_CYCLES_ONEAPI_BINARIES OFF)
+ endif()
+ endif()
else()
- message(STATUS "oneAPI or Level Zero not found, disabling oneAPI device from Cycles")
+ message(STATUS "oneAPI or Level Zero not found, disabling WITH_CYCLES_DEVICE_ONEAPI")
set(WITH_CYCLES_DEVICE_ONEAPI OFF)
endif()
endif()
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index c7dcc928c0d..f32a810786d 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -786,14 +786,6 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
get_filename_component(sycl_compiler_root ${SYCL_COMPILER} DIRECTORY)
get_filename_component(sycl_compiler_compiler_name ${SYCL_COMPILER} NAME_WE)
- if(NOT OCLOC_INSTALL_DIR)
- get_filename_component(OCLOC_INSTALL_DIR "${sycl_compiler_root}/../lib/ocloc" ABSOLUTE)
- endif()
- if(WITH_CYCLES_ONEAPI_BINARIES AND NOT EXISTS ${OCLOC_INSTALL_DIR})
- message(FATAL_ERROR "WITH_CYCLES_ONEAPI_BINARIES requires ocloc but ${OCLOC_INSTALL_DIR} directory doesn't exist."
- " A different ocloc directory can be set using OCLOC_INSTALL_DIR cmake variable.")
- endif()
-
if(UNIX AND NOT APPLE)
if(NOT WITH_CXX11_ABI)
check_library_exists(sycl