Skip to content

Commit a621f6d

Browse files
Update install and howto section (#504)
* updated the installation instructions, pulling from readme and refining with testing * my files weren't pushed; trying again * added an explanation around make * missing a word * changed a word for smoother reading * Update rocThrust-install-overview.rst * fixed typo * an initial commit of some readme topics being pulled into the doc * updated the toc/index and modified the datatype support page a bit * changed some titles
1 parent cd36fce commit a621f6d

13 files changed

+308
-169
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ There are two CMake configuration-time options that control random data fed to u
226226
reproducibility.
227227

228228
* `PRNG_SEEDS`: 1 by default, controls repeatable dataset seeds.
229-
* This is a CMake formatted (semicolon delimited) array of 32-bit unsigned integrals. Note that
229+
* This is a CMake formatted (semicolon delimited) array of 32-bit unsigned integers. Note that
230230
semicolons often collide with shell command parsing. We advise escaping the entire CMake CLI
231231
argument to avoid having the variable pick up quotation marks. For example, pass
232232
`cmake "-DPRNG_SEEDS=1;2;3;4"` instead of `cmake -DPRNG_SEEDS="1;2;3;4"` (these cases differ in
@@ -270,16 +270,19 @@ make -j4
270270
```
271271

272272
## HIPSTDPAR
273+
273274
rocThrust also hosts the header files for [HIPSTDPAR](https://rocm.blogs.amd.com/software-tools-optimization/hipstdpar/README.html#c-17-parallel-algorithms-and-hipstdpar).
274275
Within these headers, a great part of the C++ Standard Library parallel algorithms are overloaded so that rocThrust's and rocPRIM's implementations of those algorithms are used when they are invoked with the `parallel_unsequenced_policy` policy.
275276
When compiling with the proper flags (see [LLVM (AMD's fork) docs](https://github.com/ROCm/llvm-project/blob/rocm-6.2.x/clang/docs/HIPSupport.rst#implementation-driver)[^1] for the complete list), the HIPSTDPAR headers are implicitly included by the compiler, and therefore the execution of these parallel algorithms will be offloaded to AMD devices.
276277

277278
[^1]: Altough currently only AMD's fork of LLVM contains the docs for the [C++ Standard Parallelism Offload Support](https://github.com/ROCm/llvm-project/blob/rocm-6.2.x/clang/docs/HIPSupport.rst#c-standard-parallelism-offload-support-compiler-and-runtime), both of them (the upstream LLVM and AMD's fork) do support it.
278279

279280
### Install
281+
280282
HIPSTDPAR is currently packaged along rocThrust. The `hipstdpar` package is set up as a virtual package provided by `rocthrust`, so the latter needs to be installed entirely for getting HIPSTDPAR's headers. Conversely, installing the `rocthrust` package will also include HIPSTDPAR's headers in the system.
281283

282284
### Tests
285+
283286
rocThrust also includes some tests for checking the correct building of HIPSTDPAR implementations. These are located under the [tests/hipstdpar](/test/hipstdpar/) folder. When configuring the project with the `BUILD_TEST` option on, these tests will also be enabled. Additionally, one can configure **only** HIPSTDPAR's tests by disabling `BUILD_TEST` and enabling `BUILD_HIPSTDPAR_TEST`. In general, the following steps can be followed for building and running the tests:
284287

285288
```sh
@@ -300,6 +303,7 @@ ctest --output-on-failure
300303
```
301304

302305
#### Requirements
306+
303307
* [rocPRIM](https://github.com/ROCm/rocPRIM) and [rocThrust](https://github.com/ROCm/rocThrust) libraries
304308
* [TBB](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onetbb.html) library
305309
* Notice that oneTBB (oneAPI TBB) may fail to compile when libstdc++-9 or -10 is used, due to them using legacy TBB interfaces that are incompatible with the oneTBB ones (see the [release notes](https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-threading-building-blocks-release-notes.html)).

docs/data-type-support.rst

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,17 @@
88
Data type support
99
******************************************
1010

11-
Fundamental types
12-
=================
13-
14-
15-
.. list-table:: Comparison of supported fundamental types of rocThrust and Thrust
16-
:header-rows: 1
17-
:name: supported-fundamental-types-rocthrust-vs-thrust
18-
19-
*
20-
- Type
21-
- rocThrust support
22-
- Thrust support
23-
*
24-
- :code:`int8`
25-
- ✅
26-
- ✅
27-
*
28-
- :code:`int16`
29-
- ✅
30-
- ✅
31-
*
32-
- :code:`int32`
33-
- ✅
34-
- ✅
35-
*
36-
- :code:`int64`
37-
- ✅
38-
- ✅
39-
*
40-
- :code:`half` [1]_
41-
- ⚠️
42-
- ⚠️
43-
*
44-
- :code:`bfloat16` [1]_
45-
- ⚠️
46-
- ⚠️
47-
*
48-
- :code:`float`
49-
- ✅
50-
- ✅
51-
*
52-
- :code:`double`
53-
- ✅
54-
- ✅
55-
56-
Custom types
57-
============
58-
59-
rocThrust and Thrust support custom, user-defined types, if they provide the interface required by the used functions.
60-
61-
.. rubric:: Footnotes
62-
.. [1] These types are supported in rocThrust and Thrust, however the host-side hip-implementations of these types miss some functionality, and are mostly intended as storage types to be passed between functions.
11+
rocThrust supports user-defined custom types as long as an interface for them is provided.
12+
13+
rocThrust and Thrust both support the following fundamental types:
14+
15+
* ``int8``
16+
* ``int16``
17+
* ``int32``
18+
* ``int64``
19+
* ``float``
20+
* ``double``
21+
22+
23+
Both rocThrust and Thrust also support ``half`` and ``bfloat16``. However, the host-side HIP implementations of these types are missing some functionality. Because of this, ``half`` and ``bfloat16`` should be used only as storage types to be passed between functions.
24+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. meta::
2+
:description: Using multiple GPUs for testing
3+
:keywords: rocThrust, ROCm, testing, ctest, multiple GPUs, resource-spec
4+
5+
***************************************************
6+
How to run tests on multiple GPUs
7+
***************************************************
8+
9+
To run tests on multiple GPUs, you can configure your tests using the ``AMDGPU_TEST_TARGETS`` option or you can use CTest resource allocation.
10+
11+
The ``AMDGPU_TEST_TARGETS`` CTest option lets you specify the families of GPUs on which you want to run your tests. For example, if you have two GPUs from the gfx900 family in your system, you can specify ``-DAMDGPU_TEST_TARGETS=gfx900`` when you configure your test to specify that you only want that family of GPUs to be tested. If you don't set ``AMDGPU_TEST_TARGETS``, the tests will be run on the default device in your system.
12+
13+
You can use CTest resource allocation to run tests in a distributed manner across multiple GPUs and test multiple product families from one invocation.
14+
15+
CTest resource allocation requires a resource specification file. You can generate a resource specification file using the ``GenerateResourceSpec.cmake`` utility script.
16+
17+
After you have cloned the ``rocThrust`` repository and built rocThrust with the ``-DBUILD_TESTS=ON`` option, change directory to the ``build`` directory and run:
18+
19+
.. code:: shell
20+
21+
../cmake/GenerateResourceSpec.cmake
22+
23+
This will generate a ``resources.json`` file in the ``build`` directory. Use the ``resources.json`` file in your call to ``ctest``.
24+
25+
For example, if you have two compatible GPUs in your system, run:
26+
27+
.. code:: shell
28+
29+
ctest --resource-spec-file ./resources.json --parallel 2
30+
31+
32+
.. note::
33+
34+
CTest resource allocation requires CMake 3.16 or later.
35+
36+
37+
38+
39+
40+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. meta::
2+
:description: Using rocThrust in a CMake project
3+
:keywords: rocThrust, ROCm, cmake, find_package
4+
5+
*******************************************
6+
How to use rocThrust in a CMake project
7+
*******************************************
8+
9+
To use rocThrust in your own project, add the following lines to your CMakeLists file:
10+
11+
.. code::
12+
13+
# On ROCm rocThrust requires rocPRIM
14+
find_package(rocprim REQUIRED CONFIG PATHS "/opt/rocm/rocprim")
15+
16+
# "/opt/rocm" - default install prefix
17+
find_package(rocthrust REQUIRED CONFIG PATHS "/opt/rocm/rocthrust")
18+
19+
[...]
20+
21+
# include rocThrust headers and roc::rocprim_hip target
22+
target_link_libraries(<your_target> roc::rocthrust)
23+

docs/index.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,34 @@
88
rocThrust documentation
99
******************************************
1010

11-
rocThrust is a parallel algorithm library. This library has been ported to :doc:`HIP <hip:index>`/:doc:`ROCm <rocm:index>`, which use the :doc:`rocPRIM <rocprim:index>` library. The HIP ported library works on HIP/ROCm platforms. There is no CUDA backend for rocThrust.
11+
rocThrust is a parallel algorithm library that has been ported to `HIP <https://rocm.docs.amd.com/projects/HIP/en/latest/index.html>`_ and `ROCm <https://rocm.docs.amd.com/en/latest/>`_, and uses the `rocPRIM <https://rocm.docs.amd.com/projects/rocPRIM/en/latest/index.html>`_ library. There is no CUDA backend for rocThrust.
1212

13-
You can access rocThrust code on the `GitHub repository <https://github.com/ROCm/rocThrust>`_.
14-
15-
The documentation is structured as follows:
13+
The rocThrust public repository is located at `https://github.com/ROCm/rocThrust <https://github.com/ROCm/rocThrust>`_.
1614

1715
.. grid:: 2
18-
:gutter: 3
16+
:gutter: 3
1917

2018
.. grid-item-card:: Installation
2119

22-
* :ref:`install`
20+
* :doc:`Prerequisites <install/rocThrust-prerequisites>`
21+
* :doc:`Installation overview <install/rocThrust-install-overview>`
22+
* :doc:`Installing on Linux <install/rocThrust-install-script>`
23+
* :doc:`Installing on Windows <install/rocThrust-rmake-install>`
24+
* :doc:`Installing on Linux and Windows with CMake <install/rocThrust-install-with-cmake>`
25+
26+
.. grid-item-card:: How to
27+
28+
* :doc:`Add rocThrust to a CMake project <./how-to/use-rocThrust-in-a-project>`
29+
* :doc:`Run tests on multiple GPUs <./how-to/run-rocThrust-tests-on-multiple-gpus>`
2330

2431
.. grid-item-card:: API reference
2532

33+
* :doc:`Using HIPSTDPAR <./reference/rocThrust-hipstdpar>`
2634
* :ref:`data-type-support`
2735
* :ref:`bitwise-repro`
2836
* :ref:`hipgraph-support`
29-
* :ref:`api-reference`
3037
* :ref:`hip-execution-policies`
38+
* :ref:`api-reference`
3139
* :ref:`genindex`
3240

3341
To contribute to the documentation, refer to

docs/install/installing.rst

Lines changed: 0 additions & 107 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. meta::
2+
:description: rocThrust installation overview
3+
:keywords: install, rocThrust, AMD, ROCm, installation, overview, general
4+
5+
*********************************
6+
rocThrust installation overview
7+
*********************************
8+
9+
The rocThrust source code is available from the `rocThrust GitHub Repository <https://github.com/ROCmSoftwarePlatform/rocThrust>`_.
10+
11+
The develop branch is the default branch. The develop branch is intended for users who want to preview new features or contribute to the rocThrust code base.
12+
13+
If you don't intend to contribute to the rocThrust code base and won't be previewing features, use a branch that matches the version of ROCm installed on your system.
14+
15+
rocThrust can be built and installed with |install|_ on Linux, |rmake|_ on Windows, or `CMake <./rocThrust-install-with-cmake.html>`_ on Windows and Linux.
16+
17+
.. |install| replace:: ``install``
18+
.. _install: ./rocThrust-install-script.html
19+
20+
.. |rmake| replace:: ``rmake.py``
21+
.. _rmake: ./rocThrust-rmake-install.html
22+
23+
CMake provides the most flexibility in building and installing rocThrust.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. meta::
2+
:description: Build and install rocThrust with the installation script
3+
:keywords: install, building, rocThrust, AMD, ROCm, source code, installation script, Linux
4+
5+
********************************************************************
6+
Building and installing rocThrust on Linux with the install script
7+
********************************************************************
8+
9+
You can use the ``install`` script to build and install rocThrust on Linux. You can also use `CMake <./rocThrust-install-with-cmake.html>`_ if you want more build and installation options.
10+
11+
The ``install`` script is located in the ``rocThrust`` root directory. To build and install rocThrust with the ``install`` script, run:
12+
13+
.. code-block:: shell
14+
15+
./install --install
16+
17+
This command will also download and install rocPRIM.
18+
19+
To build rocThrust and generate tar, zip, and debian packages, run:
20+
21+
.. code-block:: shell
22+
23+
./install --package
24+
25+
To see a complete list of options, run:
26+
27+
.. code-block:: shell
28+
29+
./install --help
30+

0 commit comments

Comments
 (0)