2021-07-07 20:24:46 -04:00
|
|
|
### This will test linking hip::device interface in cmake
|
|
|
|
|
I. Build
|
2023-06-28 21:48:13 +05:30
|
|
|
|
|
|
|
|
```
|
2023-12-11 03:43:30 +00:00
|
|
|
$ mkdir build; cd build
|
|
|
|
|
$ CXX="$(hipconfig -l)"/clang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm ..
|
|
|
|
|
$ make
|
2023-06-28 21:48:13 +05:30
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Note, users may need to add ADMGPU support as command line option, if test failed to run, for example,
|
|
|
|
|
```
|
2023-12-11 03:43:30 +00:00
|
|
|
$ CXX="$(hipconfig -l)"/clang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DAMDGPU_TARGETS="gfx1102" ..
|
2023-06-28 21:48:13 +05:30
|
|
|
```
|
2023-09-20 14:55:28 -04:00
|
|
|
|
2021-07-07 20:24:46 -04:00
|
|
|
II. Test
|
2023-06-28 21:48:13 +05:30
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ../test_cpp
|
|
|
|
|
info: running on device AMD Radeon Graphics
|
2021-07-07 20:24:46 -04:00
|
|
|
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
|
2023-06-28 21:48:13 +05:30
|
|
|
PASSED!
|
|
|
|
|
```
|