2
0
Ficheiros
rocm-systems/samples/2_Cookbook/18_cmake_hip_device
Rakesh Roy 4dfa7ca7e6 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
2023-11-27 12:56:29 -05:00
..

This will test linking hip::device interface in cmake

I. Build

mkdir -p build; cd build
rm -rf *;
CXX="$(hipconfig -l)"/clang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm ..
make

Note, users may need to add ADMGPU support as command line option, if test failed to run, for example,

CXX="$(hipconfig -l)"/clang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DAMDGPU_TARGETS="gfx1102" ..

II. Test

$ ../test_cpp
info: running on device AMD Radeon Graphics
info: allocate host mem (  7.63 MB)
info: allocate device mem (  7.63 MB)
info: copy Host2Device
info: launch 'vector_square' kernel
info: copy Device2Host
info: check result
PASSED!