Skip to content

Commit 30d45db

Browse files
randyh62neon60
authored andcommitted
Update hip_porting_guide.rst
Updated from additional comments from Jan
1 parent 18e0a83 commit 30d45db

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

docs/how-to/hip_porting_guide.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ code and work through common issues.
1616
CUDA provides separate driver and runtime APIs, while HIP uses a single API.
1717
The two CUDA APIs generally provide similar functionality and are mostly interchangeable.
1818
However, the CUDA driver API enables fine-grained control over the kernel-level
19-
initialization, contexts, and module management. While the runtime API automatically
19+
initialization, contexts, and module management, while the runtime API automatically
2020
manages contexts and modules. The driver API is suitable for applications that need
2121
tight integration with other systems, or require advanced control over GPU resources.
2222

@@ -64,8 +64,8 @@ General Tips
6464
to HIP.
6565
* Once the CUDA code is ported to HIP and is running on the CUDA machine,
6666
compile the HIP code for an AMD machine.
67-
* You can handle platform-specific features through conditional compilation or
68-
by adding them to the open-source HIP infrastructure.
67+
* You can handle platform-specific features through conditional compilation as described
68+
in :ref:`compilation_platform`.
6969
* Use the `HIPIFY <https://github.com/ROCm/HIPIFY>`_ tools to automatically
7070
convert CUDA code to HIP, as described in the following section.
7171

@@ -198,14 +198,14 @@ ROCm provides libraries to ease porting of code relying on CUDA libraries.
198198
Most CUDA libraries have a corresponding HIP library. For more information,
199199
see either :doc:`ROCm libraries <rocm:reference/api-libraries>` or :doc:`HIPIFY CUDA compatible libraries <hipify:reference/supported_apis>`.
200200

201-
There are two flavours of libraries provided by ROCm, ones prefixed with ``hip``
202-
and ones prefixed with ``roc``. While both are written using HIP, in general
201+
There are two flavours of libraries provided by ROCm, libraries prefixed with ``hip``
202+
and libraries prefixed with ``roc``. While both are written using HIP, in general
203203
only the ``hip``-libraries are portable. The libraries with the ``roc``-prefix
204204
might also run on CUDA-capable GPUs, however they have been optimized for AMD
205205
GPUs and might use assembly code or a different API, to achieve the best
206206
performance.
207207

208-
In the case where a library provides both ``roc`` and ``hip``versions, such as
208+
In the case where a library provides both ``roc`` and ``hip`` versions, such as
209209
``hipSparse`` and ``rocSparse``, the ``hip`` version is a marshalling library,
210210
which is just a thin layer that redirects function calls to either the
211211
``roc`` library or the corresponding CUDA library, depending on the target platform.
@@ -595,32 +595,32 @@ required to implement this interaction.
595595
* - HIP type
596596
- CU Driver type
597597
- CUDA Runtime type
598-
* - ``hipModule_t``
598+
* - :cpp:type:``hipModule_t``
599599
- ``CUmodule``
600600
-
601-
* - ``hipFunction_t``
601+
* - :cpp:type:``hipFunction_t``
602602
- ``CUfunction``
603603
-
604-
* - ``hipCtx_t``
604+
* - :cpp:type:``hipCtx_t``
605605
- ``CUcontext``
606606
-
607-
* - ``hipDevice_t``
607+
* - :cpp:type:``hipDevice_t``
608608
- ``CUdevice``
609609
-
610-
* - ``hipStream_t``
610+
* - :cpp:type:``hipStream_t``
611611
- ``CUstream``
612612
- ``cudaStream_t``
613-
* - ``hipEvent_t``
613+
* - :cpp:type:``hipEvent_t``
614614
- ``CUevent``
615615
- ``cudaEvent_t``
616-
* - ``hipArray``
616+
* - :cpp:type:``hipArray_t``
617617
- ``CUarray``
618618
- ``cudaArray``
619619

620620
Compilation options
621621
-------------------
622622

623-
The ``hipModule_t`` interface does not support the ``cuModuleLoadDataEx`` function,
623+
The :cpp:type:``hipModule_t`` interface does not support the ``cuModuleLoadDataEx`` function,
624624
which is used to control PTX compilation options. HIP-Clang does not use PTX, so
625625
it does not support these compilation options. In fact, HIP-Clang code objects contain
626626
fully compiled code for a device-specific instruction set and don't require additional
@@ -648,7 +648,7 @@ For example:
648648
optionValues[0] = (void *)(&maxRegs);
649649
650650
// hipModuleLoadData(module, imagePtr) will be called on HIP-Clang path, JIT
651-
// options will not be used, and cupModuleLoadDataEx(module, imagePtr,
651+
// options will not be used, and cuModuleLoadDataEx(module, imagePtr,
652652
// numOptions, options, optionValues) will be called on NVCC path
653653
hipModuleLoadDataEx(module, imagePtr, numOptions, options, optionValues);
654654
@@ -675,7 +675,7 @@ For example:
675675
CUfunction k;
676676
cuModuleGetFunction(&k, module, "myKernel");
677677
678-
The sample below shows how to use ``hipModuleGetFunction``.
678+
The sample below shows how to use :cpp:func:``hipModuleGetFunction``.
679679

680680
.. code-block:: cpp
681681
@@ -1090,9 +1090,9 @@ functions offered by the HIP runtime, even if the application was built with an
10901090
older toolkit.
10911091

10921092
.. note::
1093-
``hipGetProcAddress`` and its CUDA counterpart ``cuGetProcAddress`` are limited
1093+
:cpp:func:``hipGetProcAddress`` and its CUDA counterpart ``cuGetProcAddress`` are limited
10941094
to HIP/CUDA driver API function calls. For HIP/CUDA runtime API calls,the corresponding
1095-
function is ``hipGetDriverEntryPoint`` / ``cudaGetDriverEntryPoint``.
1095+
function is :cpp:func:``hipGetDriverEntryPoint`` / ``cudaGetDriverEntryPoint``.
10961096

10971097
An example is provided for a hypothetical ``foo()`` function.
10981098

0 commit comments

Comments
 (0)