Fichiers
rocm-systems/samples/0_Intro/square
Aakanksha Patil da9a79a5f6 SWDEV-309659 - Delete duplicate files - hipify-perl and helper scripts (#2403)
* Delete duplicate files - hipify-perl and helper scripts
* Update link for hipconvertinplace-perl.sh references
* Remove remaining references to hipify-clang and contents of its package
* Hyperlink hipexamine-perl.sh in docs/markdown/hip_porting_guide.md
2021-11-25 15:12:09 +05:30
..

Square.md

Simple test below is an example, shows how to use hipify-perl to port CUDA code to HIP:

  • Add hip/bin path to the PATH
$ export PATH=$PATH:[MYHIP]/bin
  • Define environment variable
$ export HIP_PATH=[MYHIP]
  • Build executible file
$ cd ~/hip/samples/0_Intro/square
$ make
/opt/rocm/hip/bin/hipify-perl square.cu > square.cpp
/opt/rocm/hip/bin/hipcc  square.cpp -o square.out
/opt/rocm/hip/bin/hipcc -use-staticlib  square.cpp -o square.out.static
  • Execute file
$ ./square.out
info: running on device Navi 14 [Radeon Pro W5500]
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!