Update docs 2025 04 14 (#54)
* Update docs 2025 03 31 - Docs: remove virtual_rocr.rst - Fix documentation warnings - Reformat HIP RTC - Docs: Refactor HIP porting guide - Docs: Expand HIP porting guide and CUDA driver porting guide - Minor fix - Docs: Update environment variables file - Bump rocm-docs-core[api_reference] from 1.15.0 to 1.17.0 in /docs/sphinx - Docs: Update FP8 page to show both FP8 and FP16 types - Bump sphinxcontrib-doxylink from 1.12.4 to 1.13.0 in /docs/sphinx - Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.17.0 to 1.17.1. - Remove external link - Update programming model - Bump rocm-docs-core[api_reference] from 1.17.1 to 1.18.1 in /docs/sphinx - Docs: Add page for Complex Math API - Docs: Add page about HIP error codes - Update docs: the compilation cache is enabled by default - Fix fns32 function mask type in doc * Bump rocm-docs-core[api_reference] from 1.18.1 to 1.18.2 in /docs/sphinx Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.18.1 to 1.18.2. - [Release notes](https://github.com/ROCm/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/ROCm/rocm-docs-core/compare/v1.18.1...v1.18.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-version: 1.18.2 dependency-type: direct:production update-type: version-update:semver-patch * Fix readme link * Docs: Fix verbose paths generated by doxygen * Handle git ssh in docs conf.py
This commit is contained in:
@@ -21,6 +21,81 @@ On NVIDIA CUDA platform, ``hipcc`` takes care of invoking compiler ``nvcc``.
|
||||
``amdclang++`` is based on the ``clang++`` compiler. For more
|
||||
details, see the :doc:`llvm project<llvm-project:index>`.
|
||||
|
||||
HIPCC
|
||||
================================================================================
|
||||
|
||||
Common Compiler Options
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
The following table shows the most common compiler options supported by
|
||||
``hipcc``.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
*
|
||||
- Option
|
||||
- Description
|
||||
*
|
||||
- ``--fgpu-rdc``
|
||||
- Generate relocatable device code, which allows kernels or device functions
|
||||
to call device functions in different translation units.
|
||||
*
|
||||
- ``-ggdb``
|
||||
- Equivalent to `-g` plus tuning for GDB. This is recommended when using
|
||||
ROCm's GDB to debug GPU code.
|
||||
*
|
||||
- ``--gpu-max-threads-per-block=<num>``
|
||||
- Generate code to support up to the specified number of threads per block.
|
||||
*
|
||||
- ``-offload-arch=<target>``
|
||||
- Generate code for the given GPU target.
|
||||
For a full list of supported compilation targets see the `processor names in AMDGPU's llvm documentation <https://llvm.org/docs/AMDGPUUsage.html#processors>`_.
|
||||
This option can appear multiple times to generate a fat binary for multiple
|
||||
targets.
|
||||
The actual support of the platform's runtime may differ.
|
||||
*
|
||||
- ``-save-temps``
|
||||
- Save the compiler generated intermediate files.
|
||||
*
|
||||
- ``-v``
|
||||
- Show the compilation steps.
|
||||
|
||||
Linking
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
``hipcc`` adds the necessary libraries for HIP as well as for the accelerator
|
||||
compiler (``nvcc`` or ``amdclang++``). We recommend linking with ``hipcc`` since
|
||||
it automatically links the binary to the necessary HIP runtime libraries.
|
||||
|
||||
Linking Code With Other Compilers
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
``nvcc`` by default uses ``g++`` to generate the host code.
|
||||
|
||||
``amdclang++`` generates both device and host code. 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 ``amdclang++``
|
||||
can link with code compiled using 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++
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
``hipcc`` links to ``libstdc++`` by default. This provides better compatibility
|
||||
between ``g++`` and HIP.
|
||||
|
||||
In order to link to ``libc++``, pass ``--stdlib=libc++`` to ``hipcc``.
|
||||
Generally, libc++ provides a broader set of C++ features while ``libstdc++`` is
|
||||
the standard for more compilers, notably including ``g++``.
|
||||
|
||||
When cross-linking C++ code, any C++ functions that use types from the C++
|
||||
standard library, such as ``std::string``, ``std::vector`` and other containers,
|
||||
must use the same standard-library implementation. This includes cross-linking
|
||||
between ``amdclang++`` and other compilers.
|
||||
|
||||
|
||||
HIP compilation workflow
|
||||
================================================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user