[clang] [Clang][HIP] Add LLVM vendored device headers for `*-llvm` triple (PR #203980)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 11:54:36 PDT 2026


================
@@ -0,0 +1,239 @@
+//===--- __clang_gpu_intrinsics.h - Device-side GPU intrinsic wrappers ------===
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===-----------------------------------------------------------------------===
+
+#ifndef __CLANG_GPU_INTRINSICS_H__
+#define __CLANG_GPU_INTRINSICS_H__
+
+#if defined(__HIP__) || defined(__CUDA__)
+
+#ifndef __GPU_DEVICE__
+#error                                                                         \
+    "__clang_gpu_intrinsics.h must be included via __clang_gpu_device_functions.h"
+#endif
+
+//===----------------------------------------------------------------------===//
+// Wavefront shuffles
+//===----------------------------------------------------------------------===//
+
+template <typename __T>
+__GPU_DEVICE__ __T __gpu_shuffle_idx_impl(__T __v, unsigned int __idx,
+                                          int __w) {
+  if constexpr (sizeof(__T) == sizeof(unsigned long long))
----------------
arsenm wrote:

Braces 

https://github.com/llvm/llvm-project/pull/203980


More information about the cfe-commits mailing list