[clang] clang: Add builtin header for amdhsa abi (PR #181993)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 3 12:18:32 PST 2026
================
@@ -0,0 +1,80 @@
+//===-- amdhsa_abi.h - AMDHSA ABI definition utilities --------------------===//
+//
+// 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 __AMDHSA_ABI_H
+#define __AMDHSA_ABI_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+typedef struct __attribute__((aligned(8))) amdhsa_implicit_kernarg_v5 {
+ uint32_t block_count[3];
+ uint16_t group_size[3];
+ uint16_t remainder[3];
+ char reserved0[16];
+ uint64_t global_offset[3];
+ uint16_t grid_dims;
+ char reserved1[14];
+ __attribute__((opencl_global)) void *hostcall_buffer;
----------------
arsenm wrote:
The only way this wouldn't work is a 32-bit target, but it already asserts on every offset so it should work anyway
https://github.com/llvm/llvm-project/pull/181993
More information about the cfe-commits
mailing list