Documentation updates
Change-Id: Ia624d86915c4c96da0ac0242f767135f30ff73c6
このコミットが含まれているのは:
+55
-14
@@ -1,12 +1,14 @@
|
||||
# FAQ
|
||||
|
||||
- [What APIs and features does HIP support ?](#Q1)
|
||||
- [What is not supported?](#Q2)
|
||||
- [Run-time features](#run-time-features)
|
||||
- [Kernel language features](#kernel-language-features)
|
||||
- [Is HIP a drop-in replacement for CUDA?](#Q3)
|
||||
- [What version of CUDA is supported?](#Q4)
|
||||
- [What libraries does HIP support?](#Q5)
|
||||
<!-- toc -->
|
||||
|
||||
- [What APIs and features does HIP support?](#what-apis-and-features-does-hip-support)
|
||||
- [What is not supported?](#what-is-not-supported)
|
||||
* [Run-time features](#run-time-features)
|
||||
* [Kernel language features](#kernel-language-features)
|
||||
- [Is HIP a drop-in replacement for CUDA?](#is-hip-a-drop-in-replacement-for-cuda)
|
||||
- [What version of CUDA is supported?](#what-version-of-cuda-is-supported)
|
||||
- [What libraries does HIP support?](#what-libraries-does-hip-support)
|
||||
- [How does HIP compare with OpenCL?](#how-does-hip-compare-with-opencl)
|
||||
- [What hardware does HIP support?](#what-hardware-does-hip-support)
|
||||
- [Does Hipify automatically convert all source code?](#does-hipify-automatically-convert-all-source-code)
|
||||
@@ -18,10 +20,13 @@
|
||||
- [Can a HIP binary run on both AMD and Nvidia platforms?](#can-a-hip-binary-run-on-both-amd-and-nvidia-platforms)
|
||||
- [What's the difference between HIP and hc?](#whats-the-difference-between-hip-and-hc)
|
||||
- [HIP detected my platform (hcc vs nvcc) incorrectly - what should I do?](#hip-detected-my-platform-hcc-vs-nvcc-incorrectly---what-should-i-do)
|
||||
- [How do I trace HIP application flow?](#how-do-i-trace-hip-application-flow)
|
||||
* [Using CodeXL markers for HIP Functions](#using-codexl-markers-for-hip-functions)
|
||||
* [Using HIP_TRACE_API](#using-hip_trace_api)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
|
||||
### What APIs and features does HIP support?<a name="Q1"></a>
|
||||
### What APIs and features does HIP support?
|
||||
HIP provides the following:
|
||||
- Devices (hipSetDevice(), hipGetDeviceProperties(), etc.)
|
||||
- Memory management (hipMalloc(), hipMemcpy(), hipFree(), etc.)
|
||||
@@ -34,7 +39,7 @@ HIP provides the following:
|
||||
|
||||
The HIP API documentation describes each API and its limitations, if any, compared with the equivalent CUDA API.
|
||||
|
||||
### What is not supported?<a name="Q2"></a>
|
||||
### What is not supported?
|
||||
#### Run-time features
|
||||
- Textures
|
||||
- MemcpyToSymbol functions
|
||||
@@ -51,12 +56,12 @@ The HIP API documentation describes each API and its limitations, if any, compar
|
||||
- PTX assembly (CUDA 4.0)
|
||||
- Several kernel features are under development. See the [HIP Kernel Language](hip_kernel_language.md) for more information.
|
||||
|
||||
### Is HIP a drop-in replacement for CUDA?<a name="Q3"></a>
|
||||
### Is HIP a drop-in replacement for CUDA?
|
||||
No. HIP provides porting tools which do most of the work do convert CUDA code into portable C++ code that uses the HIP APIs.
|
||||
Most developers will port their code from CUDA to HIP and then maintain the HIP version.
|
||||
HIP code provides the same performance as coding in native CUDA, plus the benefit that the code can also run on AMD platforms.
|
||||
|
||||
### What version of CUDA is supported?<a name="Q4"></a>
|
||||
### What version of CUDA is supported?
|
||||
HIP APIs and features do not map to a specific CUDA version. HIP provides a strong subset of functionality provided in CUDA, and the hipify tools can
|
||||
scan code to identify any unsupported CUDA functions - this is very useful for identifying the specific features required by a given application.
|
||||
|
||||
@@ -81,7 +86,7 @@ However, we can provide a rough summary of the features included in each CUDA SD
|
||||
- CUDA 8.0
|
||||
- No new language features.
|
||||
|
||||
### What libraries does HIP support? <a name="Q5"></a>
|
||||
### What libraries does HIP support?
|
||||
HIP includes growing support for the 4 key math libraries using hcBlas, hcFft, hcrng, and hcsparse).
|
||||
These offer pointer-based memory interfaces (as opposed to opaque buffers) and can be easily interfaces with other HCC code. Developers should use conditional compliation if portability to nvcc systems is desired - using calls to cu* routines on one path and hc* routines on the other.
|
||||
|
||||
@@ -147,7 +152,6 @@ A C++ dialect, hc is supported by the AMD HCC compiler. It provides C++ run time
|
||||
|
||||
|
||||
### HIP detected my platform (hcc vs nvcc) incorrectly - what should I do?
|
||||
|
||||
HIP will set the platform to HCC if it sees that the AMD graphics driver is installed and has detected an AMD GPU.
|
||||
Sometimes this isn't what you want - you can force HIP to recognize the platform by setting HIP_PLATFORM to hcc (or nvcc)
|
||||
```
|
||||
@@ -157,3 +161,40 @@ export HIP_PLATFORM=hcc
|
||||
One symptom of this problem is the message "error: 'unknown error'(11) at square.hipref.cpp:56". This can occur if you have a CUDA installation on an AMD platform, and HIP incorrectly detects the platform as nvcc. HIP may be able to compile the application using the nvcc tool-chain, but will generate this error at runtime since the platform does not have a CUDA device. The fix is to set HIP_PLATFORM=hcc and rebuild the issue.
|
||||
|
||||
If you see issues related to incorrect platform detection, please file an issue with the GitHub issue tracker so we can improve HIP's platform detection logic.
|
||||
|
||||
|
||||
### How do I trace HIP application flow?
|
||||
#### Using CodeXL markers for HIP Functions
|
||||
HIP can generate markers at function being/end which are displayed on the CodeXL timeline view.
|
||||
To do this, you need to install ROCm-Profiler and enable HIP to generate the markers:
|
||||
|
||||
1. Install ROCm-Profiler
|
||||
Installing HIP from the [rocm](http://gpuopen.com/getting-started-with-boltzmann-components-platforms-installation/) pre-built packages, installs the ROCm-Profiler as well.
|
||||
Alternatively, you can build ROCm-Profiler using the instructions [here](https://github.com/RadeonOpenCompute/ROCm-Profiler#building-the-rocm-profiler).
|
||||
|
||||
2. Build HIP with ATP markers enabled
|
||||
HIP pre-built packages are enabled with ATP marker support by default.
|
||||
To enable ATP marker support when building HIP from source, use the option ```-DCOMPILE_HIP_ATP_MARKER=1``` during the cmake configure step.
|
||||
|
||||
3. Set HIP_ATP_MARKER
|
||||
```shell
|
||||
export HIP_ATP_MARKER=1
|
||||
```
|
||||
|
||||
4. Recompile the target application
|
||||
|
||||
5. Run with profiler enabled to generate ATP file.
|
||||
```shell
|
||||
# Use profile to generate timeline view:
|
||||
/opt/rocm/bin/rocm-profiler -o <outputATPFileName> -A <applicationName> <applicationArguments>
|
||||
```
|
||||
|
||||
#### Using HIP_TRACE_API
|
||||
You can also print the HIP function strings to stderr using HIP_TRACE_API environment variable. This can also be combined with the more detailed debug information provided
|
||||
by the HIP_DB switch. For example:
|
||||
```shell
|
||||
# Trace to stderr showing being/end of each function (with arguments) + intermediate debug trace during the execution of each function.
|
||||
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.
|
||||
|
||||
@@ -1,38 +1,40 @@
|
||||
**Table of Contents**
|
||||
## Table of Contents
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Function-Type Qualifiers](#function-type-qualifiers)
|
||||
- [`__device__`](#__device__)
|
||||
- [`__global__`](#__global__)
|
||||
- [`__host__`](#__host__)
|
||||
* [`__device__`](#__device__)
|
||||
* [`__global__`](#__global__)
|
||||
* [`__host__`](#__host__)
|
||||
- [Calling `__global__` Functions](#calling-__global__-functions)
|
||||
- [Kernel-Launch Example](#kernel-launch-example)
|
||||
- [Variable-Type Qualifiers](#variable-type-qualifiers)
|
||||
- [`__constant__`](#__constant__)
|
||||
- [`__shared__`](#__shared__)
|
||||
- [`__managed__`](#__managed__)
|
||||
- [`__restrict__`](#__restrict__)
|
||||
* [`__constant__`](#__constant__)
|
||||
* [`__shared__`](#__shared__)
|
||||
* [`__managed__`](#__managed__)
|
||||
* [`__restrict__`](#__restrict__)
|
||||
- [Built-In Variables](#built-in-variables)
|
||||
- [Coordinate Built-Ins](#coordinate-built-ins)
|
||||
- [warpSize](#warpsize)
|
||||
* [Coordinate Built-Ins](#coordinate-built-ins)
|
||||
* [warpSize](#warpsize)
|
||||
- [Vector Types](#vector-types)
|
||||
- [Short Vector Types](#short-vector-types)
|
||||
- [dim3](#dim3)
|
||||
* [Short Vector Types](#short-vector-types)
|
||||
* [dim3](#dim3)
|
||||
- [Memory-Fence Instructions](#memory-fence-instructions)
|
||||
- [Synchronization Functions](#synchronization-functions)
|
||||
- [Math Functions](#math-functions)
|
||||
- [Single Precision Mathematical Functions](#single-precision-mathematical-functions)
|
||||
- [Double Precision Mathematical Functions](#double-precision-mathematical-functions)
|
||||
- [Integer Intrinsics](#integer-intrinsics)
|
||||
- [Floating-point Intrinsics](#floating-point-intrinsics)
|
||||
* [Single Precision Mathematical Functions](#single-precision-mathematical-functions)
|
||||
* [Double Precision Mathematical Functions](#double-precision-mathematical-functions)
|
||||
* [Integer Intrinsics](#integer-intrinsics)
|
||||
* [Floating-point Intrinsics](#floating-point-intrinsics)
|
||||
- [Texture Functions](#texture-functions)
|
||||
- [Surface Functions](#surface-functions)
|
||||
- [Timer Functions](#timer-functions)
|
||||
- [Atomic Functions](#atomic-functions)
|
||||
- [Caveats and Features Under-Development:](#caveats-and-features-under-development)
|
||||
* [Caveats and Features Under-Development:](#caveats-and-features-under-development)
|
||||
- [Warp Cross-Lane Functions](#warp-cross-lane-functions)
|
||||
- [Warp Vote and Ballot Functions](#warp-vote-and-ballot-functions)
|
||||
- [Warp Shuffle Functions](#warp-shuffle-functions)
|
||||
* [Warp Vote and Ballot Functions](#warp-vote-and-ballot-functions)
|
||||
* [Warp Shuffle Functions](#warp-shuffle-functions)
|
||||
- [Profiler Counter Function](#profiler-counter-function)
|
||||
- [Assert](#assert)
|
||||
- [Printf](#printf)
|
||||
@@ -43,7 +45,7 @@
|
||||
- [In-Line Assembly](#in-line-assembly)
|
||||
- [C++ Support](#c-support)
|
||||
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ the porting of existing CUDA code into the HIP environment. This section descri
|
||||
and provides practical suggestions on how to port CUDA code and work through common issues.
|
||||
|
||||
## Table of Contents
|
||||
=================
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
@@ -41,8 +40,8 @@ and provides practical suggestions on how to port CUDA code and work through com
|
||||
* [Debugging hipcc](#debugging-hipcc)
|
||||
* [What Does This Error Mean?](#what-does-this-error-mean)
|
||||
+ [/usr/include/c++/v1/memory:5172:15: error: call to implicitly deleted default constructor of 'std::__1::bad_weak_ptr' throw bad_weak_ptr();](#usrincludecv1memory517215-error-call-to-implicitly-deleted-default-constructor-of-std__1bad_weak_ptr-throw-bad_weak_ptr)
|
||||
+ [HIP Environment Variables](#hip-environment-variables)
|
||||
+ [Editor Highlighting](#editor-highlighting)
|
||||
* [HIP Environment Variables](#hip-environment-variables)
|
||||
* [Editor Highlighting](#editor-highlighting)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
@@ -461,7 +460,7 @@ hipcc-cmd: /opt/hcc/bin/hcc -hc -I/opt/hcc/include -stdlib=libc++ -I../../../..
|
||||
If you pass a ".cu" file, hcc will attempt to compile it as a Cuda language file. You must tell hcc that its in fact a C++ file: use the "-x c++" option.
|
||||
|
||||
|
||||
#### HIP Environment Variables
|
||||
### HIP Environment Variables
|
||||
|
||||
On the HCC path, HIP provides a number of environment variables that control the behavior of HIP. Some of these are useful for appliction development (for example HIP_VISIBLE_DEVICES, HIP_LAUNCH_BLOCKING),
|
||||
some are useful for performance tuning or experimentation (for example HIP_STAGING*), and some are useful for debugging (HIP_DB). You can see the environment variables supported by HIP as well as
|
||||
@@ -484,5 +483,5 @@ HIP_DISABLE_HW_COPY_DEP = 1 : Disable HW dependencies before copy comman
|
||||
```
|
||||
|
||||
|
||||
#### Editor Highlighting
|
||||
### Editor Highlighting
|
||||
See the utils/vim or utils/gedit directories to add handy highlighting to hip files.
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
||||
|
||||
- [Table Comparing Syntax for Different Compute APIs](#table-comparing-syntax-for-different-compute-apis)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
# Table Comparing Syntax for Different Compute APIs
|
||||
|
||||
|Term|CUDA|HIP|HC|C++AMP|OpenCL|
|
||||
@@ -46,5 +38,3 @@
|
||||
2. The indexing functions (starting with `thread-index`) show the terminology for a 1D grid. Some APIs use reverse order of xyz / 012 indexing for 3D grids.
|
||||
3. HC allows tile dimensions to be specified at runtime while C++AMP requires that tile dimensions be specified at compile-time. Thus hc syntax for tile dims is `t_ext.tile_dim[0]` while C++AMP is t_ext.tile_dim0.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
||||
|
||||
- [Terms used in HIP Documentation](#terms-used-in-hip-documentation)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
|
||||
# Terms used in HIP Documentation
|
||||
|
||||
- host, host cpu : Executes the HIP runtime API and is capable of initiating kernel launches to one or more devices.
|
||||
@@ -24,6 +15,3 @@ The default device can be set with hipSetDevice.
|
||||
- hipify - tool to convert CUDA(R) code to portable C++ code.
|
||||
- hipconfig - tool to report various confoguration properties of the target platform.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする