Files
rocm-systems/samples/0_Intro/square
agunashe e2c6bb5b4e SWDEV-293742 - Update copyright end year
Change-Id: I2cb7bbd9a6d9da28116ba9dd9cec4e60525444e2
2021-07-07 12:57:23 -04:00
..

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
/home/user/hip/bin/hipify-perl square.cu > square.cpp
/home/user/hip/bin/hipcc  square.cpp -o square.out
/home/user/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!