summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-18 18:11:41 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-21 19:34:37 (GMT)
commit127b6fa06bf53ad9f31d041a7d11434ca2856c8e (patch)
tree26f2bdb717a1592b9a31fb6bc1cdff37f42a1373 /Help
parent90e23f40ee27c0990b30b3640731e89539cb3990 (diff)
downloadCMake-127b6fa06bf53ad9f31d041a7d11434ca2856c8e.zip
CMake-127b6fa06bf53ad9f31d041a7d11434ca2856c8e.tar.gz
CMake-127b6fa06bf53ad9f31d041a7d11434ca2856c8e.tar.bz2
HIP: Add CMAKE_HIP_PLATFORM variable to specify GPU platform
For now, require the value to be `amd`, since that is the only platform we currently support.
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/prop_tgt/HIP_ARCHITECTURES.rst3
-rw-r--r--Help/release/dev/hip-nvidia.rst6
-rw-r--r--Help/variable/CMAKE_HIP_ARCHITECTURES.rst10
-rw-r--r--Help/variable/CMAKE_HIP_PLATFORM.rst19
5 files changed, 35 insertions, 4 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index fa7a90f..536046a 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -590,6 +590,7 @@ Variables for Languages
/variable/CMAKE_Fortran_MODOUT_FLAG
/variable/CMAKE_HIP_ARCHITECTURES
/variable/CMAKE_HIP_EXTENSIONS
+ /variable/CMAKE_HIP_PLATFORM
/variable/CMAKE_HIP_STANDARD
/variable/CMAKE_HIP_STANDARD_REQUIRED
/variable/CMAKE_ISPC_HEADER_DIRECTORY
diff --git a/Help/prop_tgt/HIP_ARCHITECTURES.rst b/Help/prop_tgt/HIP_ARCHITECTURES.rst
index 06f956b..58a813d 100644
--- a/Help/prop_tgt/HIP_ARCHITECTURES.rst
+++ b/Help/prop_tgt/HIP_ARCHITECTURES.rst
@@ -3,7 +3,8 @@ HIP_ARCHITECTURES
.. versionadded:: 3.21
-List of AMD GPU architectures to generate device code for.
+List of GPU architectures to for which to generate device code.
+Architecture names are interpreted based on :variable:`CMAKE_HIP_PLATFORM`.
A non-empty false value (e.g. ``OFF``) disables adding architectures.
This is intended to support packagers and rare cases where full control
diff --git a/Help/release/dev/hip-nvidia.rst b/Help/release/dev/hip-nvidia.rst
new file mode 100644
index 0000000..f4617e7
--- /dev/null
+++ b/Help/release/dev/hip-nvidia.rst
@@ -0,0 +1,6 @@
+hip-nvidia
+----------
+
+* The :variable:`CMAKE_HIP_PLATFORM` variable was added to specify
+ the GPU platform for which HIP language sources are to be compiled
+ (``amd``).
diff --git a/Help/variable/CMAKE_HIP_ARCHITECTURES.rst b/Help/variable/CMAKE_HIP_ARCHITECTURES.rst
index bcc6b35..3f17983 100644
--- a/Help/variable/CMAKE_HIP_ARCHITECTURES.rst
+++ b/Help/variable/CMAKE_HIP_ARCHITECTURES.rst
@@ -3,10 +3,14 @@ CMAKE_HIP_ARCHITECTURES
.. versionadded:: 3.21
-Default value for :prop_tgt:`HIP_ARCHITECTURES` property of targets.
+List of GPU architectures to for which to generate device code.
+Architecture names are interpreted based on :variable:`CMAKE_HIP_PLATFORM`.
-This is initialized to the architectures reported by ``rocm_agent_enumerator``,
-if available, and otherwise to the default chosen by the compiler.
+This is initialized based on the value of :variable:`CMAKE_HIP_PLATFORM`:
+
+``amd``
+ Uses architectures reported by ``rocm_agent_enumerator``, if available,
+ and otherwise to a default chosen by the compiler.
This variable is used to initialize the :prop_tgt:`HIP_ARCHITECTURES` property
on all targets. See the target property for additional information.
diff --git a/Help/variable/CMAKE_HIP_PLATFORM.rst b/Help/variable/CMAKE_HIP_PLATFORM.rst
new file mode 100644
index 0000000..1715066
--- /dev/null
+++ b/Help/variable/CMAKE_HIP_PLATFORM.rst
@@ -0,0 +1,19 @@
+CMAKE_HIP_PLATFORM
+------------------
+
+.. versionadded:: 3.28
+
+GPU platform for which HIP language sources are to be compiled.
+
+The value must be one of:
+
+``amd``
+ AMD GPUs
+
+If not specified, the default is ``amd``.
+
+:variable:`CMAKE_HIP_ARCHITECTURES` entries are interpreted with
+as architectures of the GPU platform.
+
+:variable:`CMAKE_HIP_COMPILER <CMAKE_<LANG>_COMPILER>` must target
+the same GPU platform.