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>2021-10-05 14:08:44 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-10-05 14:47:50 +0300
commit55b8fc718a378423cd4b6d93258779e201877b1d (patch)
treec2dc2e53ad7678bf4719c77c700c6030fc1c1599 /intern/cycles/kernel/CMakeLists.txt
parent71cf9f4b3f0b750325a0037c4ef5c43fea71248f (diff)
Cycles: improve detection of HIP compiler for buildbot
And fix various broken things in the HIP kernel compilation.
Diffstat (limited to 'intern/cycles/kernel/CMakeLists.txt')
-rw-r--r--intern/cycles/kernel/CMakeLists.txt39
1 files changed, 15 insertions, 24 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 7b56216e887..514b7f8263c 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -472,20 +472,10 @@ endif()
# HIP module
-if(WITH_CYCLES_HIP_BINARIES)
+if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
# 64 bit only
set(HIP_BITS 64)
- # HIP version
- execute_process(COMMAND ${HIP_HIPCC_EXECUTABLE} "--version" OUTPUT_VARIABLE HIPCC_OUT)
- string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" HIP_VERSION_MAJOR "${HIPCC_OUT}")
- string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" HIP_VERSION_MINOR "${HIPCC_OUT}")
- set(HIP_VERSION "${HIP_VERSION_MAJOR}${HIP_VERSION_MINOR}")
-
-
- message(WARNING
- "HIP version ${HIP_VERSION_MAJOR}.${HIP_VERSION_MINOR} detected")
-
# build for each arch
set(hip_sources device/hip/kernel.cpp
${SRC_HEADERS}
@@ -542,23 +532,24 @@ if(WITH_CYCLES_HIP_BINARIES)
-D WITH_NANOVDB
-I "${NANOVDB_INCLUDE_DIR}")
endif()
+
+ add_custom_command(
+ OUTPUT ${hip_file}
+ COMMAND ${HIP_HIPCC_EXECUTABLE}
+ -arch=${arch}
+ ${HIP_HIPCC_FLAGS}
+ --${format}
+ ${CMAKE_CURRENT_SOURCE_DIR}${hip_kernel_src}
+ ${hip_flags}
+ DEPENDS ${kernel_sources})
+ delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${hip_file}" ${CYCLES_INSTALL_PATH}/lib)
+ list(APPEND hip_fatbins ${hip_file})
endmacro()
set(prev_arch "none")
foreach(arch ${CYCLES_HIP_BINARIES_ARCH})
- set(hip_hipcc_executable ${HIP_HIPCC_EXECUTABLE})
- set(hip_toolkit_root_dir ${HIP_TOOLKIT_ROOT_DIR})
- if(DEFINED hip_hipcc_executable AND DEFINED hip_toolkit_root_dir)
- # Compile regular kernel
- CYCLES_HIP_KERNEL_ADD(${arch} ${prev_arch} kernel "" "${hip_sources}" FALSE)
-
- if(WITH_CYCLES_HIP_BUILD_SERIAL)
- set(prev_arch ${arch})
- endif()
-
- unset(hip_hipcc_executable)
- unset(hip_toolkit_root_dir)
- endif()
+ # Compile regular kernel
+ CYCLES_HIP_KERNEL_ADD(${arch} ${prev_arch} kernel "" "${hip_sources}" FALSE)
endforeach()
add_custom_target(cycles_kernel_hip ALL DEPENDS ${hip_fatbins})