2022-06-17 10:40:48 +05:30
|
|
|
### This will test HIP language support in upstream CMake
|
|
|
|
|
I. Build
|
2023-06-28 21:59:03 +05:30
|
|
|
|
|
|
|
|
```
|
2022-06-17 10:40:48 +05:30
|
|
|
mkdir -p build; cd build
|
2023-06-28 21:59:03 +05:30
|
|
|
rm -rf *;
|
|
|
|
|
cmake -DCMAKE_PREFIX_PATH=/opt/rocm ..
|
2022-06-17 10:40:48 +05:30
|
|
|
make
|
2023-06-28 21:59:03 +05:30
|
|
|
```
|
2022-06-17 10:40:48 +05:30
|
|
|
|
|
|
|
|
II. Test
|
2023-06-28 21:59:03 +05:30
|
|
|
|
|
|
|
|
```
|
2022-06-17 10:40:48 +05:30
|
|
|
$ ./square
|
|
|
|
|
info: running on device
|
|
|
|
|
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!
|
2023-06-28 21:59:03 +05:30
|
|
|
```
|