summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeHIPCompilerABI.hip
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-09 11:53:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-06-09 11:53:32 (GMT)
commit7aad9e8685b0231abfb11d0f7d8c613cf5364fef (patch)
tree2d2b547cbc6708936c98ae52c0f181d78fb0652d /Modules/CMakeHIPCompilerABI.hip
parentb6faa5e2df22fecac877dc866294e8b5a36ab03a (diff)
parent8514ee9b315b4ad02eed0e3cf11d8579f307fac0 (diff)
downloadCMake-7aad9e8685b0231abfb11d0f7d8c613cf5364fef.zip
CMake-7aad9e8685b0231abfb11d0f7d8c613cf5364fef.tar.gz
CMake-7aad9e8685b0231abfb11d0f7d8c613cf5364fef.tar.bz2
Merge topic 'add_hip_language'
8514ee9b31 HIP: analyze output of `hipcc` to determine default GPU architecture 20d086f1a2 HIP: All HIP tests now run on CMake's current AMD hardware 2e86e50c2f HIP: Add HIP to all the Check* modules 947dbed0aa HIP: Automatically inject the `hip::device` runtime target b50bfc8913 HIP: Add language to CMake ff0d2858e1 HIP: Extract clang compiler details from hipcc bd844387df ROCMClang: Add the ROCm toolkit derived clang compiler to CMake 590553f322 Compilers: protect use of __has_include ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Zack Galbreath <zack.galbreath@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Acked-by: Axel Huebl <axel.huebl@plasma.ninja> Merge-request: !6121
Diffstat (limited to 'Modules/CMakeHIPCompilerABI.hip')
-rw-r--r--Modules/CMakeHIPCompilerABI.hip16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/CMakeHIPCompilerABI.hip b/Modules/CMakeHIPCompilerABI.hip
new file mode 100644
index 0000000..6c912bd
--- /dev/null
+++ b/Modules/CMakeHIPCompilerABI.hip
@@ -0,0 +1,16 @@
+#ifndef __HIP__
+# error "A C or C++ compiler has been selected for HIP"
+#endif
+
+#include "CMakeCompilerABI.h"
+
+int main(int argc, char* argv[])
+{
+ int require = 0;
+ require += info_sizeof_dptr[argc];
+#if defined(ABI_ID)
+ require += info_abi[argc];
+#endif
+ (void)argv;
+ return require;
+}