Remove disable spellchecks of cmake-packages.rst (#2676)

This commit is contained in:
Istvan Kiss
2023-11-27 19:17:13 +01:00
committed by GitHub
parent f51e1144df
commit f8446befd2

View File

@@ -71,25 +71,22 @@ Source code written in the HIP dialect of C++ typically uses the `.hip`
extension. When the HIP CMake language is enabled, it will automatically
associate such source files with the HIP toolchain being used.
.. <!-- spellcheck-disable -->
.. code-block:: cpp
cmake_minimum_required(VERSION 3.21) # HIP language support requires 3.21
cmake_policy(VERSION 3.21.3...3.27)
project(MyProj LANGUAGES HIP)
add_executable(MyApp Main.hip)
.. <!-- spellcheck-enable -->
Should you have existing CUDA code that is from the source compatible subset of
HIP, you can tell CMake that despite their `.cu` extension, they're HIP sources.
Do note that this mostly facilitates compiling kernel code-only source files,
as host-side CUDA API won't compile in this fashion.
.. <!-- spellcheck-disable -->
.. code-block:: cpp
add_library(MyLib MyLib.cu)
set_source_files_properties(MyLib.cu PROPERTIES LANGUAGE HIP)
.. <!-- spellcheck-enable -->
CMake itself only hosts part of the HIP language support, such as defining
HIP-specific properties, etc. while the other half ships with the HIP
@@ -114,7 +111,6 @@ Illustrated in the example below is a C++ application using MIOpen from CMake.
It calls ``find_package(miopen)``, which provides the ``MIOpen`` imported
target. This can be linked with ``target_link_libraries``
.. <!-- spellcheck-disable -->
.. code-block:: cpp
cmake_minimum_required(VERSION 3.5) # find_package(miopen) requires 3.5
@@ -123,7 +119,7 @@ target. This can be linked with ``target_link_libraries``
find_package(miopen)
add_library(MyLib ...)
target_link_libraries(MyLib PUBLIC MIOpen)
.. <!-- spellcheck-enable -->
.. note::
Most libraries are designed as host-only API, so using a GPU device
@@ -137,8 +133,7 @@ Use the HIP API without compiling the GPU device code. As there is no GPU code,
any C or C++ compiler can be used. The ``find_package(hip)`` provides the
``hip::host`` imported target to use HIP in this context.
.. <!-- spellcheck-disable -->
.. code-block:: cpp
.. code-block:: cpp
cmake_minimum_required(VERSION 3.5) # find_package(hip) requires 3.5
cmake_policy(VERSION 3.5...3.27)
@@ -146,7 +141,6 @@ any C or C++ compiler can be used. The ``find_package(hip)`` provides the
find_package(hip REQUIRED)
add_executable(MyApp ...)
target_link_libraries(MyApp PRIVATE hip::host)
.. <!-- spellcheck-enable -->
Compiling device code in C++ language mode
------------------------------------------
@@ -169,7 +163,6 @@ compiler that supports AMD GPU targets, which is usually Clang.
The ``find_package(hip)`` provides the ``hip::device`` imported target to add
all the flags necessary for device compilation.
.. <!-- spellcheck-disable -->
.. code-block:: cpp
cmake_minimum_required(VERSION 3.8) # cxx_std_11 requires 3.8
@@ -179,7 +172,6 @@ all the flags necessary for device compilation.
add_library(MyLib ...)
target_link_libraries(MyLib PRIVATE hip::device)
target_compile_features(MyLib PRIVATE cxx_std_11)
.. <!-- spellcheck-enable -->
.. note::
@@ -286,8 +278,8 @@ Following is an example ``CMakeUserPresets.json`` file which actually compiles
the `amd/rocm-examples <https://github.com/amd/rocm-examples>`_ suite of sample
applications on a typical ROCm installation:
.. <!-- spellcheck-disable -->
.. code-block:: json
{
"version": 3,
"cmakeMinimumRequired": {
@@ -385,7 +377,6 @@ applications on a typical ROCm installation:
}
]
}
.. <!-- spellcheck-enable -->
.. note::