From 3dd6104c87caffac31058761b1df3f6fdb3de314 Mon Sep 17 00:00:00 2001 From: Xavier Hallade Date: Thu, 3 Apr 2025 11:44:22 +0200 Subject: [PATCH] Cycles: oneAPI: Fix building for non-Intel SYCL targets without ocloc The current logic disables WITH_CYCLES_ONEAPI_BINARIES when ocloc is not found, which is fine, but prevented building for other non-Intel SYCL targets without (unnecessary) ocloc. The fix here is to remove spir64_gen target when WITH_CYCLES_ONEAPI_BINARIES is disabled, instead of forcing only spir64. --- intern/cycles/kernel/CMakeLists.txt | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index f5b24ef0e7d..516c31f8adf 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -1026,24 +1026,21 @@ if(WITH_CYCLES_DEVICE_ONEAPI) else() string(PREPEND CYCLES_ONEAPI_SYCL_OPTIONS_spir64_gen "-device ${gen_devices_string} ") endif() - - # Iterate over all targets and their options. - list(JOIN CYCLES_ONEAPI_SYCL_TARGETS "," targets_string) - list(APPEND sycl_compiler_flags -fsycl-targets=${targets_string}) - foreach(target ${CYCLES_ONEAPI_SYCL_TARGETS}) - if(DEFINED CYCLES_ONEAPI_SYCL_OPTIONS_${target}) - list(APPEND sycl_compiler_flags - "-Xsycl-target-backend=${target} \"${CYCLES_ONEAPI_SYCL_OPTIONS_${target}}\"" - ) - endif() - endforeach() else() - # If AOT is disabled, build for spir64 - list(APPEND sycl_compiler_flags - -fsycl-targets=spir64 - "-Xsycl-target-backend=spir64 \"${CYCLES_ONEAPI_SYCL_OPTIONS_spir64}\"") + list(REMOVE_ITEM CYCLES_ONEAPI_SYCL_TARGETS spir64_gen) endif() + # Iterate over all targets and their options. + list(JOIN CYCLES_ONEAPI_SYCL_TARGETS "," targets_string) + list(APPEND sycl_compiler_flags -fsycl-targets=${targets_string}) + foreach(target ${CYCLES_ONEAPI_SYCL_TARGETS}) + if(DEFINED CYCLES_ONEAPI_SYCL_OPTIONS_${target}) + list(APPEND sycl_compiler_flags + "-Xsycl-target-backend=${target} \"${CYCLES_ONEAPI_SYCL_OPTIONS_${target}}\"" + ) + endif() + endforeach() + if(WITH_NANOVDB) list(APPEND sycl_compiler_flags -DWITH_NANOVDB)