commit 9548493fa754b3bf5c31cbdc2211db1e73e8c07c Author: Jack Chung <whchung@gmail.com> Date: Mon May 23 11:57:23 2016 +0800 Rename hipExternShared test to hipDynamicShared Change-Id: I180d9d539420fb69cfc121eceaa7db9da03483b2 commit 827081f8244a38f010789d556db0c4ff7b6422d8 Author: Jack Chung <whchung@gmail.com> Date: Mon May 23 11:56:27 2016 +0800 Rename HIP_DECLARE_EXTERN_SHARED to HIP_DYNAMIC_SHARED Change-Id: I22362d179812ac547e0f11ba4e2bb999050e08ae commit 4c277228ed41af187739610fa17eab1fb144c947 Author: Jack Chung <whchung@gmail.com> Date: Thu May 19 17:49:52 2016 +0800 Adopt new interface to get dynamic LDS in hc.hpp Change-Id: I47b433b714633a4c97df87c40a0b1d3386429a00 commit 5a36117d777064113a528dc47b42e8c8413baa97 Author: Jack Chung <whchung@gmail.com> Date: Thu May 19 11:29:24 2016 +0800 Add test patterns for regular expression to match "extern __shared__" These test patterns should better be saved as an individual test case, but I'm not familiar with HIP test structures so I leave them as comments in hipify as of now. Change-Id: I7fee89c89b9e73de2133357a226ec0c769733531 commit 1b26284168c7f5339f63338fd0149bed5d994656 Author: Jack Chung <whchung@gmail.com> Date: Thu May 19 11:25:23 2016 +0800 Add one HIP unit test to use HIP_DECLARE_EXTERN_SHARED Change-Id: I4d9907815920693a74ea9d575fe26e7c67636109 commit 77b816ee5972b13d829d5bbcf06fbfd07acea2af Author: Jack Chung <whchung@gmail.com> Date: Wed May 18 19:18:59 2016 +0800 Adopt HIP_ prefix for DECLARE_EXTERN_SHARED macro Change-Id: I555ded16b449b67d2e20904013d86fe1ded6a2be commit ef0997939c3578a9ae11621bf21c0416f04d2622 Author: Jack Chung <whchung@gmail.com> Date: Wed May 18 17:42:04 2016 +0800 Modify hipify to support converting extern __shared__ to DECLARE_EXTERN_SHARED macro Added regular expression to search & replace extern __shared__ declarations to DECLARE_EXTERN_SHARED macro. Limitation: - Won't work if "extern __shared__" is declared at global scope Sample Usages: extern __shared__ double foo[]; extern __shared__ unsigned int foo[]; extern volatile __shared__ double foo[]; extern volatile __shared__ unsigned int sdata[]; extern __shared__ volatile unsigned int sdata[]; extern __shared__ T s[]; extern __shared__ T::type s[]; extern __shared__ blah<T>::type s[]; extern __shared__ typename mapper<Float>::type s_data[]; extern __attribute__((used)) __shared__ typename mapper<Float>::type s_data[]; Change-Id: I2be0b7039adeddb789f5a2b067d403a43fdc3e26 commit 93ff268724493aedfacdcd5a5aa9a100f4ebaed0 Author: Jack Chung <whchung@gmail.com> Date: Wed May 18 15:13:09 2016 +0800 Introduce DECLARE_EXTERN_SHARED macro to encapsulate "extern __shared__" decls Change-Id: I93b2d37c763195b0ca9fd0afee78605a1e3272db commit cff9c95412de343cc6405158b5acc4f1029267ff Author: Jack Chung <whchung@gmail.com> Date: Wed May 18 12:53:54 2016 +0800 Add __get_dynamic_groupbaseptr() to point to dynamic LDS Change-Id: I97b548d8a691488057617c551a8f331cad7afc77 Change-Id: I84e7875b76fa1f59e860e19c93bd4209cdd1fd2c
What is this repository for?
HIP allows developers to convert CUDA code to portable C++. The same source code can be compiled to run on NVIDIA or AMD GPUs. Key features include:
- HIP is very thin and has little or no performance impact over coding directly in CUDA or hcc "HC" mode.
- HIP allows coding in a single-source C++ programming language including features such as templates, C++11 lambdas, classes, namespaces, and more.
- HIP allows developers to use the "best" development environment and tools on each target platform.
- The "hipify" tool automatically converts source from CUDA to HIP.
- Developers can specialize for the platform (CUDA or hcc) to tune for performance or handle tricky cases
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.
More Info:
- Installation and clang-hipify
- HIP FAQ
- HIP Kernel Language
- HIP Runtime API (Doxygen)
- HIP Porting Guide
- HIP Terminology (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
- Developer/CONTRIBUTING Info
- Release Notes
How do I get set up?
See the Installation notes.
Examples and Getting Started:
- A sample and blog that uses hipify to convert a simple app from CUDA to HIP:
cd samples/01_Intro/square
# follow README / blog steps to hipify the application.
- A sample and blog demonstrating platform specialization:
cd samples/01_Intro/bit_extract
make
- Guide to Porting a New Cuda Project
More Examples
The GitHub repot HIP-Examples contains a hipified vesion of the popular Rodinia benchmark suite. The README with the procedures and tips the team used during this porting effort is here: Rodinia Porting Guide
Tour of the HIP Directories
-
include:
- hip_runtime_api.h : Defines HIP runtime APIs and can be compiled with many standard Linux compilers (hcc, GCC, ICC, CLANG, etc), in either C or C++ mode.
- hip_runtime.h : Includes everything in hip_runtime_api.h PLUS hipLaunchKernel and syntax for writing device kernels and device functions. hip_runtime.h can only be compiled with hcc.
- hcc_detail/** , nvcc_detail/** : Implementation details for specific platforms. HIP applications should not include these files directly.
- hcc.h : Includes interop APIs for HIP and HCC
-
bin: Tools and scripts to help with hip porting
- hipify : Tool to convert CUDA code to portable CPP. Converts CUDA APIs and kernel builtins.
- hipcc : Compiler driver that can be used to replace nvcc in existing CUDA code. hipcc ill call nvcc or hcc depending on platform, and include appropriate platform-specific headers and libraries.
- hipconfig : Print HIP configuration (HIP_PATH, HIP_PLATFORM, CXX config flags, etc)
- hipexamine.sh : Script to scan directory, find all code, and report statistics on how much can be ported with HIP (and identify likely features not yet supported)
-
doc: Documentation - markdown and doxygen info
Reporting an issue
Use the [GitHub issue tracker] (https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues). If reporting a bug, include the output of "hipconfig --full" and samples/1_hipInfo/hipInfo (if possible).