Skip to content

Commit

Permalink
[DFT] Improve support for different ROCm versions (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy authored Apr 10, 2024
1 parent 4e5150d commit 028d8ba
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/dft/backends/rocfft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 028d8ba

Please sign in to comment.