SWDEV-425678 - Fix build failure in HIP samples

- Due to file reorg path changes cmake fails at find_package(hip) unless CMAKE_PREFIX_PATH is set explicitly
- Update CMakeLists.txt to set CMAKE_PREFIX_PATH
- Update Readme

Change-Id: Ibdb4419efcdd6583b059a728e48dfdb8f927a48b
Этот коммит содержится в:
Rakesh Roy authored and Rahul Manocha committed 2023-11-27 12:56:29 -05:00
1 родитель d04b8bf458
Коммит 4dfa7ca7e6
30 files changed
+220 -6

No files matched your search

+8
Просмотреть файл
@@ -30,6 +30,14 @@ if(${__HIP_ENABLE_PCH})
add_definitions(-D__HIP_ENABLE_PCH)
endif()
if(UNIX)
if(NOT DEFINED ROCM_PATH)
set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.")
endif()
# Search for rocm in common locations
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
endif()
# Find hip
find_package(hip)
+9
Просмотреть файл
@@ -23,6 +23,15 @@ project(module_api)
cmake_minimum_required(VERSION 3.10)
include_directories(../../common)
if(UNIX)
if(NOT DEFINED ROCM_PATH)
set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.")
endif()
# Search for rocm in common locations
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
endif()
# Find hip
find_package(hip)
+8
Просмотреть файл
@@ -22,6 +22,14 @@ project(module_api_global)
cmake_minimum_required(VERSION 3.10)
if(UNIX)
if(NOT DEFINED ROCM_PATH)
set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.")
endif()
# Search for rocm in common locations
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
endif()
# Find hip
find_package(hip)
+8
Просмотреть файл
@@ -24,6 +24,14 @@ project(square)
cmake_minimum_required(VERSION 3.10)
if(UNIX)
if(NOT DEFINED ROCM_PATH)
set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.")
endif()
# Search for rocm in common locations
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
endif()
# create square.cpp
execute_process(COMMAND sh -c "${CMAKE_PREFIX_PATH}/bin/hipify-perl ../square.cu > ../square.cpp")
+1 -1
Просмотреть файл
@@ -20,7 +20,7 @@ $ export HIP_PATH=[MYHIP]
$ cd ~/hip/samples/0_Intro/square
mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=<path/to/rocm> -DHIP_CXX_COMPILER=<path/to/clang> ..
cmake ..
make
$ Building without cmake