Merge branch 'release_0.84.00' into privatestaging

Conflicts:
	include/hcc_detail/hip_runtime.h
	src/hip_hcc.cpp


[ROCm/hip commit: ffdf6ab23b]
This commit is contained in:
Maneesh Gupta
2016-04-22 10:55:58 +05:30
bovenliggende 940d891899 b197cb30cb
commit 90fa90295f
220 gewijzigde bestanden met toevoegingen van 5545 en 11003 verwijderingen
+24 -16
Bestand weergeven
@@ -11,15 +11,21 @@ Key features include:
New projects can be developed directly in the portable HIP C++ language and can run on either NVIDIA or AMD platforms. Additionally, HIP provides porting tools which make it easy to port existing CUDA codes to the HIP layer, with no loss of performance as compared to the original CUDA application. HIP is not intended to be a drop-in replacement for CUDA, and developers should expect to do some manual coding and performance tuning work to complete the port.
## Installation
```
```shell
cd HIP-privatestaging
mkdir build
cd build
cmake -DHSA_PATH=/path/to/hsa -DHCC_HOME=/path/to/hcc -DCMAKE_INSTALL_PREFIX=/where/to/install/hip -DCMAKE_BUILD_TYPE=Release ..
cmake ..
make
make install
```
Make sure HIP_PATH is pointed to `/where/to/install/hip` and PATH includes `$HIP_PATH/bin`. This requirement is optional, but required to run any HIP test infrastructure.
*By default cmake looks for hcc in /opt/rocm/hcc (can be overridden by setting ```-DHCC_HOME=/path/to/hcc``` in the cmake step).*
*By default cmake looks for HSA in /opt/rocm/hsa (can be overridden by setting ```-DHSA_PATH=/path/to/hsa``` in the cmake step).*
*By default cmake installs HIP to /opt/rocm/hip (can be overridden by setting ```-DCMAKE_INSTALL_PREFIX=/where/to/install/hip``` in the cmake step).*
*Make sure HIP_PATH is pointed to `/where/to/install/hip` and PATH includes `$HIP_PATH/bin`. This requirement is optional, but required to run any HIP test infrastructure.*
## More Info:
- [HIP FAQ](docs/markdown/hip_faq.md)
@@ -49,13 +55,14 @@ HIP code can be developed either on AMD ROCm platform using hcc compiler, or a C
#### NVIDIA (nvcc)
* Install CUDA SDK from manufacturer website
* By default HIP looks for CUDA SDK in /usr/local/cuda (can be overriden by setting CUDA_PATH env variable)
* Install HIP (from this GitHub repot). By default HIP is installed into /opt/rocm/hip (can be overridden by setting HIP_PATH environment variable).
```
* Optionally, consider adding /opt/rocm/bin to your path to make it easier to use the tools.
#### Verify your installation
Run hipconfig (instructions below assume default installation path) :
```
> /opt/rocm/bin/hipconfig --full
```shell
/opt/rocm/bin/hipconfig --full
```
Compile and run the [square sample](https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/tree/master/samples/0_Intro/square).
@@ -74,31 +81,31 @@ Also this [blog](http://gpuopen.com/getting-up-to-speed-with-the-codexl-gpu-prof
and visualization tools, CodeXL also comes with an SDK that allow applications to add markers to the timeline viewer. We'll be linking HIP against this library.
2. Set CODEXL_PATH
```
```shell
# set to your code-xl installation location:
export CODEXL_PATH=/opt/AMD/CodeXL
```
3. Enable in source code.
In src/hip_hcc.cpp, enable the define
```
```c
#define COMPILE_TRACE_MARKER 1
```
Then recompile the target application, run with profiler enabled to generate ATP file or trace log.
```
```shell
# Use profiler to generate timeline view:
$ $CODEXL_PATH/CodeXLGpuProfiler -A -o ./myHipApp
$CODEXL_PATH/CodeXLGpuProfiler -A -o ./myHipApp
...
Session output path: /home/me/HIP-privatestaging/tests/b1/mytrace.atp
```
You can also print the HIP function strings to stderr using HIP_TRACE_API environment variable. This can be useful for tracing application flow. Also can be combined with the more detailed debug information provided
by the HIP_DB switch. For example:
```
```shell
# Trace to stderr showing begin/end of each function (with arguments) + intermediate debug trace during the execution of each function.
$ HIP_TRACE_API=1 HIP_DB=0x2 ./myHipApp
HIP_TRACE_API=1 HIP_DB=0x2 ./myHipApp
```
Note this trace mode uses colors. "less -r" can handle raw control characters and will display the debug output in proper colors.
@@ -115,7 +122,8 @@ Here's how to use it with HIP:
> (In the make step for HCC, we recommend setting -DCMAKE_INSTALL_PREFIX=/opt/hcc-native)
Set HCC_HOME environment variable before compiling HIP program to point to the native compiler:
> export HCC_HOME=/opt/hcc-native
```shell
export HCC_HOME=/opt/hcc-native
```
## Examples and Getting Started:
@@ -124,14 +132,14 @@ Set HCC_HOME environment variable before compiling HIP program to point to the n
```shell
> cd samples/01_Intro/square
cd samples/01_Intro/square
# follow README / blog steps to hipify the application.
```
* A sample and [blog](http://gpuopen.com/platform-aware-coding-inside-hip/) demonstrating platform specialization:
```shell
> cd samples/01_Intro/bit_extract
> make
cd samples/01_Intro/bit_extract
make
```
* Guide to [Porting a New Cuda Project](docs/markdown/hip_porting_guide.md#porting-a-new-cuda-project" aria-hidden="true"><span aria-hidden="true)