Skip to content

Commit 2ebd869

Browse files
yhuiYHrandyh62samjwu
authored
Port hipcc doc reorg to docs/6.2.0 (#130)
* hipcc docs update * minor edit * remove note about llvm * fix syntax * Conditionally skip docs PR build If there is no change to the docs folder or RTD YAML compared to the amd-staging branch --------- Co-authored-by: randyh62 <randyh@amd.com> Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
1 parent 10d4cf3 commit 2ebd869

File tree

12 files changed

+145
-48
lines changed

12 files changed

+145
-48
lines changed

amd/hipcc/.readthedocs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,16 @@ build:
1616
os: ubuntu-22.04
1717
tools:
1818
python: "3.10"
19+
jobs:
20+
post_checkout:
21+
# Cancel building pull requests when there aren't changed in the docs directory or YAML file.
22+
# You can add any other files or directories that you'd like here as well,
23+
# like your docs requirements file, or other files that will change your docs build.
24+
#
25+
# If there are no changes (git diff exits with 0) we force the command to return with 183.
26+
# This is a special exit code on Read the Docs that will cancel the build immediately.
27+
- |
28+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/amd-staging -- docs/ .readthedocs.yaml;
29+
then
30+
exit 183;
31+
fi

amd/hipcc/docs/build.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

amd/hipcc/docs/build.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. meta::
2+
:description: HIPCC environment variables
3+
:keywords: HIPCC, ROCm, HIP tools, HIP compiler
4+
5+
.. _hipcc_build:
6+
7+
******************************************
8+
Building and testing HIPCC
9+
******************************************
10+
11+
To build the ``hipcc`` and ``hipconfig`` executables, use the following commands.
12+
13+
.. code-block:: bash
14+
15+
mkdir build
16+
cd build
17+
18+
cmake ..
19+
20+
make -j
21+
22+
.. note::
23+
The tools are created in the current build folder, and will need to be copied to ``/opt/rocm/hip/bin`` folder location.
24+
25+
Testing HIPCC
26+
=============
27+
28+
Currently ``hipcc`` and ``hipconfig`` tools are tested by building and running test samples that can be found at `HIP-tests <https://github.com/ROCm/hip-tests/tree/develop/samples>`_.

amd/hipcc/docs/env.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

amd/hipcc/docs/env.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. meta::
2+
:description: HIPCC environment variables
3+
:keywords: HIPCC, ROCm, HIP tools, HIP compiler
4+
5+
.. _hipcc_vars:
6+
7+
******************************************
8+
HIPCC environment variables
9+
******************************************
10+
11+
The environment variable ``HIP_PLATFORM`` can be used to specify ``amd`` or ``nvidia`` depending on the available backend tool flows:
12+
13+
* ``HIP_PLATFORM`` = ``amd`` or ``HIP_PLATFORM`` = ``nvidia``
14+
15+
.. note::
16+
If ``HIP_PLATFORM`` is not set, then ``hipcc`` will attempt to auto-detect based on if the ``nvcc`` tool is found.
17+
18+
Additional environment variable controls:
19+
20+
* ``CUDA_PATH`` : Path to the CUDA SDK. The default is ``/usr/local/cuda``. This is only used for NVIDIA platforms.

amd/hipcc/docs/index.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

amd/hipcc/docs/index.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.. meta::
2+
:description: HIPCC command
3+
:keywords: HIPCC, ROCm, HIP tools, HIP compiler
4+
5+
.. _hipcc-docs:
6+
7+
******************************************
8+
HIPCC documentation
9+
******************************************
10+
11+
``hipcc`` is a compiler driver utility that will call clang or nvcc, depending on target, and pass the appropriate include and library options for the target compiler and HIP infrastructure.
12+
13+
There is both a Perl version, and a C++ executable version of the ``hipcc`` and ``hipconfig`` compiler driver utilities provided. By default the Perl version is used when ``hipcc`` is run. To enable the C++ versions, set the environment variable ``HIP_USE_PERL_SCRIPTS=0``.
14+
15+
16+
The documentation is structured as follows:
17+
18+
.. grid:: 2
19+
:gutter: 3
20+
21+
.. grid-item-card:: Installation
22+
23+
* :ref:`hipcc_build`
24+
* :ref:`hipcc_vars`
25+
26+
.. grid-item-card:: How to
27+
28+
* :ref:`hipcc_use`
29+
30+
To contribute to the documentation, refer to
31+
`Contributing to ROCm <https://rocm.docs.amd.com/en/latest/contribute/contributing.html>`_.
32+
33+
You can find licensing information on the
34+
`Licensing <https://rocm.docs.amd.com/en/latest/about/license.html>`_ page.

amd/hipcc/docs/sphinx/_toc.yml.in

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Anywhere {branch} is used, the branch name will be substituted.
22
# These comments will also be removed.
3+
defaults:
4+
numbered: False
5+
maxdepth: 6
36
root: index
47
subtrees:
5-
- numbered: False
6-
entries:
7-
- file: env
8-
- file: usage
9-
- file: build
10-
- file: test
11-
- caption: About
12-
entries:
13-
- file: license
8+
9+
- caption: Install
10+
entries:
11+
- file: build
12+
- file: env
13+
14+
- caption: How to
15+
entries:
16+
- file: usage
17+
18+
- caption: About
19+
entries:
20+
- file: license.md

amd/hipcc/docs/test.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

amd/hipcc/docs/usage.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

amd/hipcc/docs/usage.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. meta::
2+
:description: HIPCC environment variables
3+
:keywords: HIPCC, ROCm, HIP tools, HIP compiler
4+
5+
.. _hipcc_use:
6+
7+
******************************************
8+
Using HIPCC
9+
******************************************
10+
11+
The built executables can be used the same way as the ``hipcc`` and ``hipconfig`` Perl scripts.
12+
To use the newly built executables from the build folder use ``./`` in front of the executable name.
13+
For example:
14+
15+
.. code-block:: shell
16+
17+
./hipconfig --help
18+
./hipcc --help
19+
./hipcc --version
20+
./hipconfig --full
21+

openmp/.readthedocs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,16 @@ build:
1616
os: ubuntu-22.04
1717
tools:
1818
python: "3.10"
19+
jobs:
20+
post_checkout:
21+
# Cancel building pull requests when there aren't changed in the docs directory or YAML file.
22+
# You can add any other files or directories that you'd like here as well,
23+
# like your docs requirements file, or other files that will change your docs build.
24+
#
25+
# If there are no changes (git diff exits with 0) we force the command to return with 183.
26+
# This is a special exit code on Read the Docs that will cancel the build immediately.
27+
- |
28+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/amd-staging -- docs/ .readthedocs.yaml;
29+
then
30+
exit 183;
31+
fi

0 commit comments

Comments
 (0)