diff options
author | Xavier Hallade <xavier.hallade@intel.com> | 2022-10-06 19:35:51 +0300 |
---|---|---|
committer | Xavier Hallade <xavier.hallade@intel.com> | 2022-10-07 10:50:05 +0300 |
commit | 7eeeaec6da33971ab7805c9a4bfd5f4e186273d1 (patch) | |
tree | f3090686dab61d3a25d77fdbece49f1bc4c04ca4 /intern/cycles/kernel/CMakeLists.txt | |
parent | fc0b1627ebb821b1897cbca7f6ba9be29e52359a (diff) |
Cycles: use direct linking for oneAPI backend
This is a minimal set of changes, allowing a lot of cleanup that can
happen afterward as it allows sycl method and objects to be used outside
of kernel.cpp.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D15397
Diffstat (limited to 'intern/cycles/kernel/CMakeLists.txt')
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 9cf9b761651..bbf8fb8682b 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -716,7 +716,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI) if(WIN32) set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/cycles_kernel_oneapi.dll) else() - set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/cycles_kernel_oneapi.so) + set(cycles_kernel_oneapi_lib ${CMAKE_CURRENT_BINARY_DIR}/libcycles_kernel_oneapi.so) endif() set(cycles_oneapi_kernel_sources @@ -815,6 +815,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI) if(WIN32) list(APPEND sycl_compiler_flags + -fuse-ld=link -fms-extensions -fms-compatibility -D_WINDLL @@ -888,33 +889,24 @@ if(WITH_CYCLES_DEVICE_ONEAPI) endif() endif() + if(NOT WITH_BLENDER) + # For the Cycles standalone put libraries next to the Cycles application. + set(cycles_oneapi_target_path ${CYCLES_INSTALL_PATH}) + else() + # For Blender put the libraries next to the Blender executable. + # + # Note that the installation path in the delayed_install is relative to the versioned folder, + # which means we need to go one level up. + set(cycles_oneapi_target_path "../") + endif() + # install dynamic libraries required at runtime if(WIN32) - set(SYCL_RUNTIME_DEPENDENCIES - sycl.dll - pi_level_zero.dll - ) - if(NOT WITH_BLENDER) - # For the Cycles standalone put libraries next to the Cycles application. - delayed_install("${sycl_compiler_root}" "${SYCL_RUNTIME_DEPENDENCIES}" ${CYCLES_INSTALL_PATH}) - else() - # For Blender put the libraries next to the Blender executable. - # - # Note that the installation path in the delayed_install is relative to the versioned folder, - # which means we need to go one level up. - delayed_install("${sycl_compiler_root}" "${SYCL_RUNTIME_DEPENDENCIES}" "../") - endif() + delayed_install("" "${cycles_kernel_oneapi_lib}" ${cycles_oneapi_target_path}) elseif(UNIX AND NOT APPLE) - file(GLOB SYCL_RUNTIME_DEPENDENCIES - ${sycl_compiler_root}/../lib/libsycl.so - ${sycl_compiler_root}/../lib/libsycl.so.[0-9] - ${sycl_compiler_root}/../lib/libsycl.so.[0-9].[0-9].[0-9]-[0-9] - ) - list(APPEND SYCL_RUNTIME_DEPENDENCIES ${sycl_compiler_root}/../lib/libpi_level_zero.so) - delayed_install("" "${SYCL_RUNTIME_DEPENDENCIES}" ${CYCLES_INSTALL_PATH}/lib) + delayed_install("" "${cycles_kernel_oneapi_lib}" ${cycles_oneapi_target_path}/lib) endif() - delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cycles_kernel_oneapi_lib}" ${CYCLES_INSTALL_PATH}/lib) add_custom_target(cycles_kernel_oneapi ALL DEPENDS ${cycles_kernel_oneapi_lib}) endif() |