[mlir] Correctly handle HIP_PATH when ROCM_PATH is set
authorKrzysztof Drewniak <Krzysztof.Drewniak@amd.com>
Mon, 26 Sep 2022 20:46:17 +0000 (20:46 +0000)
committerKrzysztof Drewniak <Krzysztof.Drewniak@amd.com>
Tue, 27 Sep 2022 14:33:33 +0000 (14:33 +0000)
With the CMake file as written, if code elsewhere had set ROCM_PATH,
then HIP_PATH would not be set, breaking the rest of the ROCm
execution utility handling.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D134674

mlir/lib/ExecutionEngine/CMakeLists.txt

index f5bc430..85fc811 100644 (file)
@@ -189,8 +189,8 @@ if(MLIR_ENABLE_ROCM_RUNNER)
     else()
       set(ROCM_PATH $ENV{ROCM_PATH} CACHE PATH "Path to which ROCm has been installed")
     endif()
-    set(HIP_PATH "${ROCM_PATH}/hip" CACHE PATH "Path to which HIP has been installed")
   endif()
+  set(HIP_PATH "${ROCM_PATH}/hip" CACHE PATH "Path to which HIP has been installed")
   set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH})
   find_package(HIP)
   if (NOT HIP_FOUND)