Files
rocm-systems/samples/2_Cookbook/18_cmake_hip_device/README.md
T
Julia Jiang 547de9c274 SWDEV-393746 - Fix for HIP-sample tests failure
Change-Id: Ifb2dc03cfa82bb96f5f0d21b3848a5cda0baf9bc
2023-09-27 11:55:17 -04:00

653 B

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!