Skip to content

Commit 65d0571

Browse files
committed
Apply and standardize Read the Docs documentation for HIPCC
Relates to #12 Relates to ROCm/rocm-docs-core#330 Change-Id: Ic6a67f6edb21898c2ac8cf1dce91e94c507af4ad
1 parent 427e3b3 commit 65d0571

File tree

9 files changed

+52
-14
lines changed

9 files changed

+52
-14
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/.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ formats: [htmlzip, pdf, epub]
1010

1111
python:
1212
install:
13-
- requirements: docs/.sphinx/requirements.txt
13+
- requirements: docs/sphinx/requirements.txt
1414

1515
build:
16-
os: ubuntu-20.04
16+
os: ubuntu-22.04
1717
tools:
1818
python: "3.8"

amd/hipcc/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,41 @@
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. Historically, `hipcc` was provided as a script in the HIP repo [https://github.com/ROCm-Developer-Tools/HIP/blob/main/bin/hipcc](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.
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

2222
## Documentation
2323

2424
Run the steps below to build documentation locally.
2525

26-
```
26+
```shell
2727
cd docs
2828

29-
pip3 install -r .sphinx/requirements.txt
29+
pip3 install -r sphinx/requirements.txt
3030

3131
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
3232
```
3333

3434
### <a name="envVar"></a> Environment Variables
3535

3636
The environment variable HIP_PLATFORM may be used to specify amd/nvidia:
37+
3738
- HIP_PLATFORM='amd' or HIP_PLATFORM='nvidia'.
3839
- If HIP_PLATFORM is not set, then hipcc will attempt to auto-detect based on if nvcc is found.
3940

4041
Other environment variable controls:
42+
4143
- HIP_PATH : Path to HIP directory, default is one dir level above location of hipcc.
4244
- CUDA_PATH : Path to CUDA SDK (default /usr/local/cuda). Used on NVIDIA platforms only.
4345
- HSA_PATH : Path to HSA dir (defaults to ../../hsa relative to abs_path of hipcc). Used on AMD platforms only.

amd/hipcc/docs/.sphinx/requirements.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

amd/hipcc/docs/conf.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,27 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7+
import re
8+
79
from rocm_docs import ROCmDocs
810

9-
docs_core = ROCmDocs("HIPCC Documentation")
11+
with open('../CMakeLists.txt', encoding='utf-8') as f:
12+
match = re.search(r'.*\bproject\(hipcc VERSION\s+\"?([0-9.]+)[^0-9.]+', f.read())
13+
if not match:
14+
raise ValueError("VERSION not found!")
15+
version_number = match[1]
16+
left_nav_title = f"HIPCC {version_number} Documentation"
17+
18+
# for PDF output on Read the Docs
19+
project = "HIPCC Documentation"
20+
author = "Advanced Micro Devices, Inc."
21+
copyright = "Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved."
22+
version = version_number
23+
release = version_number
24+
25+
external_toc_path = "./sphinx/_toc.yml"
26+
27+
docs_core = ROCmDocs(left_nav_title)
1028
docs_core.setup()
1129

1230
for sphinx_var in ROCmDocs.SPHINX_VARS:

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 renamed to amd/hipcc/docs/sphinx/_toc.yml.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ subtrees:
88
- file: usage
99
- file: build
1010
- file: test
11+
- caption: About
12+
entries:
13+
- file: license

amd/hipcc/docs/sphinx/requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rocm-docs-core==0.27.0

amd/hipcc/docs/.sphinx/requirements.txt renamed to amd/hipcc/docs/sphinx/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.8
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile requirements.in
@@ -92,7 +92,7 @@ requests==2.28.2
9292
# via
9393
# pygithub
9494
# sphinx
95-
rocm-docs-core>=0.24.0
95+
rocm-docs-core==0.27.0
9696
# via -r requirements.in
9797
smmap==5.0.0
9898
# via gitdb

0 commit comments

Comments
 (0)