From d78e52fa0c2e178dec8e6b42e121109b50c54ca3 Mon Sep 17 00:00:00 2001 From: Nicholas Malaya Date: Wed, 17 Oct 2018 14:11:25 -0500 Subject: [PATCH] Small editing changes to clean up document [ROCm/hip commit: b1b93666566ec9fd69413306a99bafce54cb32a8] --- .../hip/docs/markdown/hip_porting_guide.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/projects/hip/docs/markdown/hip_porting_guide.md b/projects/hip/docs/markdown/hip_porting_guide.md index 85aa7ceaad..34e0f22d5d 100644 --- a/projects/hip/docs/markdown/hip_porting_guide.md +++ b/projects/hip/docs/markdown/hip_porting_guide.md @@ -111,9 +111,9 @@ For each input file FILE, this script will: This is useful for testing improvements to the hipify toolset. -The "hipconvertinplace.sh" script will perform inplace conversion for all code files in the specified directory. +The [hipconvertinplace.sh](https://github.com/ROCm-Developer-Tools/HIP/blob/master/bin/hipconvertinplace.sh) script will perform inplace conversion for all code files in the specified directory. This can be quite handy when dealing with an existing CUDA code base since the script preserves the existing directory structure -and filenames - so includes work. After converting in-place, you can review the code to add additional parameters to +and filenames - and includes work. After converting in-place, you can review the code to add additional parameters to directory names. @@ -164,7 +164,7 @@ Often, it's useful to know whether the underlying compiler is hcc, hip-clang or // Compiled with nvcc (Cuda language extensions enabled) ``` -hcc and hip-clang directly generates the host code (using the Clang x86 target) and passes the code to another host compiler. Thus, it lacks the equivalent of the \__CUDA_ACC define. +hcc and hip-clang directly generates the host code (using the Clang x86 target) and passes the code to another host compiler. Thus, they have no equivalent of the \__CUDA_ACC define. The macro `__HIPCC__` is set if either `__HCC__`, `__HIP__` or `__CUDACC__` is defined. This configuration is useful in determining when code is being compiled using an accelerator-enabled compiler (hcc or nvcc) as opposed to a standard host compiler (GCC, ICC, Clang, etc.). @@ -177,7 +177,7 @@ Both nvcc and hcc make two passes over the code: one for host code and one for d #if __HIP_DEVICE_COMPILE__ ``` -Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 1 or undefined, and it doesn’t represent the feature capability of the target device. +Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 1 or undefined, and it doesn't represent the feature capability of the target device. ### Compiler Defines: Summary @@ -212,7 +212,7 @@ Some Cuda code tests `__CUDA_ARCH__` for a specific value to determine whether t #if (__CUDA_ARCH__ >= 130) // doubles are supported ``` -This type of code requires special attention, since hcc/AMD and nvcc/Cuda devices have different architectural capabilities. Moreover, you can’t determine the presence of a feature using a simple comparison against an architecture’s version number. HIP provides a set of defines and device properties to query whether a specific architectural feature is supported. +This type of code requires special attention, since hcc/AMD and nvcc/Cuda devices have different architectural capabilities. Moreover, you can't determine the presence of a feature using a simple comparison against an architecture's version number. HIP provides a set of defines and device properties to query whether a specific architectural feature is supported. The `__HIP_ARCH_*` defines can replace comparisons of `__CUDA_ARCH__` values: ``` @@ -259,9 +259,8 @@ The table below shows the full set of architectural properties that HIP supports |`__HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__` | hasFunnelShift |Funnel shift two input words into one |Sync: | | |`__HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__` | hasThreadFenceSystem |threadfence\_system -|`__HIP_ARCH_HAS_SYNC_THREAD_EXT__` | hasSyncThreadsExt |syncthreads\_count, syncthreads\_and, syncthreads\_or -| -|Miscellaneous: | | +|`__HIP_ARCH_HAS_SYNC_THREAD_EXT__` | hasSyncThreadsExt |syncthreads\_count, syncthreads\_and, syncthreads\_or +|Miscellaneous: | | |`__HIP_ARCH_HAS_SURFACE_FUNCS__` | hasSurfaceFuncs | |`__HIP_ARCH_HAS_3DGRID__` | has3dGrid | Grids and groups are 3D |`__HIP_ARCH_HAS_DYNAMIC_PARALLEL__` | hasDynamicParallelism | @@ -343,7 +342,7 @@ It also uses a standard compiler (g++) for the rest of the application. nvcc is Code compiled using this tool can employ only the intersection of language features supported by both nvcc and the host compiler. In some cases, you must take care to ensure the data types and alignment of the host compiler are identical to those of the device compiler. Only some host compilers are supported---for example, recent nvcc versions lack Clang host-compiler capability. -hcc generates both device and host code using the same Clang-based compiler. The code uses the same API as gcc, which allows code generated by different gcc-compatible compilers to be linked together. For example, code compiled using hcc can link with code compiled using "standard" compilers (such as gcc, ICC and Clang). You must take care to ensure all compilers use the same standard C++ header and library formats. +hcc generates both device and host code using the same Clang-based compiler. The code uses the same API as gcc, which allows code generated by different gcc-compatible compilers to be linked together. For example, code compiled using hcc can link with code compiled using "standard" compilers (such as gcc, ICC and Clang). Take care to ensure all compilers use the same standard C++ header and library formats. ### libc++ and libstdc++ @@ -553,7 +552,7 @@ hipcc-cmd: /opt/hcc/bin/hcc -hc -I/opt/hcc/include -stdlib=libc++ -I../../../.. #### /usr/include/c++/v1/memory:5172:15: error: call to implicitly deleted default constructor of 'std::__1::bad_weak_ptr' throw bad_weak_ptr(); -If you pass a ".cu" file, hcc will attempt to compile it as a Cuda language file. You must tell hcc that it’s in fact a C++ file: use the "-x c++" option. +If you pass a ".cu" file, hcc will attempt to compile it as a Cuda language file. You must tell hcc that it's in fact a C++ file: use the "-x c++" option. ### HIP Environment Variables