aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <tburnus@baylibre.com>2025-04-17 10:21:05 +0200
committerAndrew Stubbs <ams@baylibre.com>2025-04-28 14:39:13 +0000
commitfd91f571f6e986f84f09f35139ff0650caa669d6 (patch)
tree596d9525939b6197ad805e935e9db6decef221e3
parent0572eb1918b4de3a27a24cf0a21c9b71aea7c5f7 (diff)
downloadgcc-fd91f571f6e986f84f09f35139ff0650caa669d6.zip
gcc-fd91f571f6e986f84f09f35139ff0650caa669d6.tar.gz
gcc-fd91f571f6e986f84f09f35139ff0650caa669d6.tar.bz2
libgomp.texi: For HIP interop, mention cpp defines to set
The HIP header files recognize the used compiler, defaulting to either AMD or Nvidia/CUDA; thus, the alternative way of explicitly defining a macro is less prominently documented. With GCC, the user has to define the preprocessor macro manually. Hence, as a service to the user, mention __HIP_PLATFORM_AMD__ and __HIP_PLATFORM_NVIDIA__ in the interop documentation, even though it has only indirectly to do with GCC and its interop support. Note to commit-log readers, only: For Fortran, the hipfort modules can be used; when compiling the hipfort package (defaults to use gfortran), it generates the module (*.mod) files in include/hipfort/{amdgcn,nvidia}/ such that the choice is made by setting the respective include path. libgomp/ChangeLog: * libgomp.texi (gcn interop, nvptx interop): For HIP with C/C++, add a note about setting a preprocessor define. (cherry picked from commit 4bff3f0b89af9a9aad69b8f85859c0a3667533ae)
-rw-r--r--libgomp/libgomp.texi6
1 files changed, 6 insertions, 0 deletions
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index 42dabfc..32d6514 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -6828,6 +6828,9 @@ or string (str) data type, call @code{omp_get_interop_int},
Note that @code{device_num} is the OpenMP device number
while @code{device} is the HIP device number or HSA device handle.
+When using HIP with C and C++, the @code{__HIP_PLATFORM_AMD__} preprocessor
+macro must be defined before including the HIP header files.
+
For the API routine call, add the prefix @code{omp_ipr_} to the property name;
for instance:
@smallexample
@@ -6990,6 +6993,9 @@ or string (str) data type, call @code{omp_get_interop_int},
Note that @code{device_num} is the OpenMP device number while @code{device}
is the CUDA, CUDA Driver, or HIP device number.
+When using HIP with C and C++, the @code{__HIP_PLATFORM_NVIDIA__} preprocessor
+macro must be defined before including the HIP header files.
+
For the API routine call, add the prefix @code{omp_ipr_} to the property name;
for instance:
@smallexample