2016-01-26 10:43:41 -05:00
|
|
|
# Square.md
|
2016-01-26 20:14:33 -06:00
|
|
|
|
2016-01-27 00:23:47 -06:00
|
|
|
Simple test which shows how to use hipify to port CUDA code to HIP.
|
2017-12-02 07:44:27 -06:00
|
|
|
See related [blog](http://gpuopen.com/hip-to-be-squared-an-introductory-hip-tutorial) that explains the example.
|
|
|
|
|
Now it is even simpler and requires no manual modification to the hipified source code - just hipify and compile:
|
2016-01-26 20:14:33 -06:00
|
|
|
|
|
|
|
|
1. Add hip/bin path to the PATH :
|
2016-01-26 10:43:41 -05:00
|
|
|
<code>export PATH=$PATH:[MYHIP]/bin</code>
|
2016-01-26 20:14:33 -06:00
|
|
|
|
2017-12-02 07:44:27 -06:00
|
|
|
2. <code>$ make </code>
|
|
|
|
|
Make runs these steps. This can be performed on either CUDA or AMD platform:
|
|
|
|
|
<code>hipify-perl square.cu > square.cpp </code> # convert cuda code to hip code
|
|
|
|
|
<code>hipcc square.cpp</code> # compile into executable
|