From 028d8bac8cbac674877d6302f2d87cfc87d7ac03 Mon Sep 17 00:00:00 2001 From: Romain Biessy Date: Wed, 10 Apr 2024 10:20:56 +0200 Subject: [PATCH] [DFT] Improve support for different ROCm versions (#471) --- src/dft/backends/rocfft/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/dft/backends/rocfft/CMakeLists.txt b/src/dft/backends/rocfft/CMakeLists.txt index 51c0ca177..32581208a 100644 --- a/src/dft/backends/rocfft/CMakeLists.txt +++ b/src/dft/backends/rocfft/CMakeLists.txt @@ -41,10 +41,24 @@ target_include_directories(${LIB_OBJ} target_compile_options(${LIB_OBJ} PRIVATE ${ONEMKL_BUILD_COPT}) find_package(HIP REQUIRED) -find_package(rocfft REQUIRED) +# Require the minimum rocFFT version matching with ROCm 5.4.3. +find_package(rocfft 1.0.21 REQUIRED) target_link_libraries(${LIB_OBJ} PRIVATE hip::host roc::rocfft) +# Allow to compile for different ROCm versions. See the README for the supported +# ROCm versions. +# Starting ROCm >=6.0 the include files are one directory level deeper. +find_path( + rocfft_EXTRA_INCLUDE_DIR + rocfft.h + PATHS ${rocfft_INCLUDE_DIR} + PATH_SUFFIXES rocfft + NO_DEFAULT_PATH + REQUIRED +) +target_include_directories(${LIB_OBJ} PRIVATE ${rocfft_EXTRA_INCLUDE_DIR}) + target_link_libraries(${LIB_OBJ} PUBLIC ONEMKL::SYCL::SYCL) set_target_properties(${LIB_OBJ} PROPERTIES