clang 23.0.0git
amdhsa_abi.h
Go to the documentation of this file.
1//===-- amdhsa_abi.h - AMDHSA ABI definition utilities --------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef __AMDHSA_ABI_H
10#define __AMDHSA_ABI_H
11
12#include <stddef.h>
13#include <stdint.h>
14
15typedef struct __attribute__((aligned(8))) amdhsa_implicit_kernarg_v5 {
16 uint32_t block_count[3];
17 uint16_t group_size[3];
18 uint16_t remainder[3];
19 char reserved0[16];
20 uint64_t global_offset[3];
21 uint16_t grid_dims;
22 char reserved1[6];
23 __attribute__((opencl_global)) void *printf_buffer;
24 __attribute__((opencl_global)) void *hostcall_buffer;
25 __attribute__((opencl_global)) void *multigrid_sync_arg;
26 __attribute__((opencl_global)) void *heap_v1;
27 __attribute__((opencl_global)) void *default_queue;
28 __attribute__((opencl_global)) void *completion_action;
29 char reserved2[72];
30 uint32_t private_base; // Unused on gfx9+
31 uint32_t shared_base; // Unused on gfx9+
32 __attribute__((opencl_global)) void *queue_ptr;
33 char reserved3[48];
35
36_Static_assert(sizeof(amdhsa_implicit_kernarg_v5) == 256, "wrong struct size");
37
38_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[0]) == 0,
39 "wrong offset");
40_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[1]) == 4,
41 "wrong offset");
42_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[2]) == 8,
43 "wrong offset");
44_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[0]) == 12,
45 "wrong offset");
46_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[1]) == 14,
47 "wrong offset");
48_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[2]) == 16,
49 "wrong offset");
50_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[0]) == 18,
51 "wrong offset");
52_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[1]) == 20,
53 "wrong offset");
54_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[2]) == 22,
55 "wrong offset");
56_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[0]) == 40,
57 "wrong offset");
58_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[1]) == 48,
59 "wrong offset");
60_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[2]) == 56,
61 "wrong offset");
62_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, grid_dims) == 64,
63 "wrong offset");
64_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, printf_buffer) == 72,
65 "wrong offset");
66_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, hostcall_buffer) == 80,
67 "wrong offset");
68_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, multigrid_sync_arg) == 88,
69 "wrong offset");
70_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, heap_v1) == 96,
71 "wrong offset");
72_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, default_queue) == 104,
73 "wrong offset");
74_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, completion_action) == 112,
75 "wrong offset");
76_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, private_base) == 192,
77 "wrong offset");
78_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, shared_base) == 196,
79 "wrong offset");
80_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, queue_ptr) == 200,
81 "wrong offset");
82
83#endif // __AMDHSA_ABI_H
_Float16 __2f16 __attribute__((ext_vector_type(2)))
Zeroes the upper 128 bits (bits 255:128) of all YMM registers.
#define offsetof(t, d)
amdhsa_implicit_kernarg_v5
Definition amdhsa_abi.h:34
#define remainder(__x, __y)
Definition tgmath.h:1090