a45f6f7ff3
Change-Id: I80a474947ea1b755082dad5329d1aff3ee78840c
21 lignes
450 B
CMake
21 lignes
450 B
CMake
project(gpuarch)
|
|
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
# Search for rocm in common locations
|
|
list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm)
|
|
|
|
# Find hip
|
|
find_package(hip)
|
|
|
|
# Set compiler and linker
|
|
set(CMAKE_CXX_COMPILER ${HIP_HIPCC_EXECUTABLE})
|
|
set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE})
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
# Create the excutable
|
|
add_executable(gpuarch gpuarch.cpp)
|
|
|
|
# Link with HIP
|
|
target_link_libraries(gpuarch hip::host)
|