Skip to content

Commit 6b51e01

Browse files
yhuiYHsamjwuDavid Salinasrandyh62
authored
Port HIPCC doc reorg to 6.1.1 (#94)
* Apply and standardize Read the Docs documentation for HIPCC Relates to #12 Relates to ROCm/rocm-docs-core#330 Change-Id: Ic6a67f6edb21898c2ac8cf1dce91e94c507af4ad * SWDEV-385160 - clean up references to Environment Variables Change-Id: I2d1581cda76aa48a46e1f0a173a963c16fe9a36b * hipcc docs update * minor edit * remove note about llvm * fix syntax --------- Co-authored-by: Sam Wu <[email protected]> Co-authored-by: David Salinas <[email protected]> Co-authored-by: randyh62 <[email protected]>
1 parent c062ef5 commit 6b51e01

File tree

13 files changed

+165
-78
lines changed

13 files changed

+165
-78
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip" # See documentation for possible values
4+
directory: "/amd/hipcc/docs/sphinx" # Location of package manifests
5+
open-pull-requests-limit: 10
6+
schedule:
7+
interval: "daily"
8+
labels:
9+
- "documentation"
10+
reviewers:
11+
- "samjwu"

amd/hipcc/README.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,63 @@
55
<!-- toc -->
66

77
- [hipcc](#hipcc)
8-
* [Documentation](#documentation)
9-
* [Environment Variables](#envVar)
10-
* [Usage](#hipcc-usage)
11-
* [Building](#building)
12-
* [Testing](#testing)
8+
- [Documentation](#documentation)
9+
- [Environment Variables](#envVar)
10+
- [Usage](#usage)
11+
- [Building](#building)
12+
- [Testing](#testing)
1313

1414
<!-- tocstop -->
1515

1616
## <a name="hipcc"></a> hipcc
1717

18-
`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. Historically, `hipcc` was provided as a script in the HIP repo ( https://github.com/ROCm-Developer-Tools/HIP/blob/main/bin/hipcc ). The `hipcc` provided in this project provides the same functionality, but is a binary rather than a script. At some point in the future, the hipcc script will be deprecated and ultimately removed from the HIP repo.
18+
`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.
1919

2020
`hipcc` will pass-through options to the target compiler. The tools calling hipcc must ensure the compiler options are appropriate for the target compiler.
2121

22+
### <a name="building"></a> Building
23+
24+
Building on Linux:
25+
26+
```bash
27+
mkdir build
28+
cd build
29+
30+
cmake ..
31+
32+
make -j4
33+
```
34+
35+
The hipcc and hipconfig executables are created in the current build folder.
36+
You may also create installable packages with :
37+
```bash
38+
make package
39+
```
40+
2241
## Documentation
2342

2443
Run the steps below to build documentation locally.
2544

26-
```
45+
```shell
2746
cd docs
2847

29-
pip3 install -r .sphinx/requirements.txt
48+
pip3 install -r sphinx/requirements.txt
3049

3150
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
3251
```
3352

3453
### <a name="envVar"></a> Environment Variables
3554

3655
The environment variable HIP_PLATFORM may be used to specify amd/nvidia:
56+
3757
- HIP_PLATFORM='amd' or HIP_PLATFORM='nvidia'.
3858
- If HIP_PLATFORM is not set, then hipcc will attempt to auto-detect based on if nvcc is found.
3959

4060
Other environment variable controls:
41-
- HIP_PATH : Path to HIP directory, default is one dir level above location of hipcc.
61+
4262
- CUDA_PATH : Path to CUDA SDK (default /usr/local/cuda). Used on NVIDIA platforms only.
43-
- HSA_PATH : Path to HSA dir (defaults to ../../hsa relative to abs_path of hipcc). Used on AMD platforms only.
44-
- HIP_ROCCLR_HOME : Path to HIP/ROCclr directory. Used on AMD platforms only.
45-
- HIP_CLANG_PATH : Path to HIP-Clang (default to ../../llvm/bin relative to hipcc's abs_path). Used on AMD platforms only.
4663

47-
### <a name="usage"></a> hipcc: usage
64+
### <a name="usage"></a> Usage
4865

4966
The built executables can be used the same way as the hipcc/hipconfig perl scripts.
5067
To use the newly built executables from the build folder use ./ in front of the executable name -
@@ -56,22 +73,6 @@ Example:
5673
./hipconfig --full
5774
```
5875

59-
when the excutables are copied to /opt/rocm/hip/bin or <anyfolder>hip/bin.
60-
The ./ is not required as the HIP path is added to the envirnoment variables list.
61-
62-
### <a name="building"></a> hipcc: building
63-
64-
```bash
65-
mkdir build
66-
cd build
67-
68-
cmake ..
69-
70-
make -j
71-
```
72-
73-
The hipcc and hipconfig executables are created in the current build folder. These executables need to be copied to /opt/rocm/hip/bin folder location. Packaging and installing will be handled in future releases.
74-
7576
### <a name="testing"></a> hipcc: testing
7677

77-
Currently hipcc/hipconfig executables are tested by building and executing HIP tests. Separate tests for hipcc/hipconfig is currently not planned.
78+
Currently hipcc/hipconfig executables are tested by building and executing HIP tests: https://github.com/ROCm/hip-tests

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 & 11 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/license.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License
2+
3+
```{include} ../LICENSE.txt
4+
```

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +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
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+

0 commit comments

Comments
 (0)