LLVM 22.0.0git
AMDGPUMetadata.h
Go to the documentation of this file.
1//===--- AMDGPUMetadata.h ---------------------------------------*- C++ -*-===//
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/// \file
10/// AMDGPU metadata definitions and in-memory representations.
11///
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_SUPPORT_AMDGPUMETADATA_H
16#define LLVM_SUPPORT_AMDGPUMETADATA_H
17
18#include "llvm/ADT/StringRef.h"
20#include <cstdint>
21#include <string>
22#include <system_error>
23#include <vector>
24
25namespace llvm {
26namespace AMDGPU {
27
28//===----------------------------------------------------------------------===//
29// HSA metadata.
30//===----------------------------------------------------------------------===//
31namespace HSAMD {
32
33/// HSA metadata major version for code object V3.
35/// HSA metadata minor version for code object V3.
37
38/// HSA metadata major version for code object V4.
40/// HSA metadata minor version for code object V4.
42
43/// HSA metadata major version for code object V5.
45/// HSA metadata minor version for code object V5.
47
48/// HSA metadata major version for code object V6.
50/// HSA metadata minor version for code object V6.
52
53/// Old HSA metadata beginning assembler directive for V2. This is only used for
54/// diagnostics now.
55
56/// HSA metadata beginning assembler directive.
57constexpr char AssemblerDirectiveBegin[] = ".amd_amdgpu_hsa_metadata";
58
59/// Access qualifiers.
61 Default = 0,
62 ReadOnly = 1,
63 WriteOnly = 2,
64 ReadWrite = 3,
65 Unknown = 0xff
66};
67
68/// Address space qualifiers.
70 Private = 0,
71 Global = 1,
72 Constant = 2,
73 Local = 3,
74 Generic = 4,
75 Region = 5,
76 Unknown = 0xff
77};
78
79/// Value kinds.
80enum class ValueKind : uint8_t {
81 ByValue = 0,
82 GlobalBuffer = 1,
84 Sampler = 3,
85 Image = 4,
86 Pipe = 5,
87 Queue = 6,
91 HiddenNone = 10,
97 Unknown = 0xff
98};
99
100/// Value types. This is deprecated and only remains for compatibility parsing
101/// of old metadata.
102enum class ValueType : uint8_t {
103 Struct = 0,
104 I8 = 1,
105 U8 = 2,
106 I16 = 3,
107 U16 = 4,
108 F16 = 5,
109 I32 = 6,
110 U32 = 7,
111 F32 = 8,
112 I64 = 9,
113 U64 = 10,
114 F64 = 11,
115 Unknown = 0xff
116};
117
118//===----------------------------------------------------------------------===//
119// Kernel Metadata.
120//===----------------------------------------------------------------------===//
121namespace Kernel {
122
123//===----------------------------------------------------------------------===//
124// Kernel Attributes Metadata.
125//===----------------------------------------------------------------------===//
126namespace Attrs {
127
128namespace Key {
129/// Key for Kernel::Attr::Metadata::mReqdWorkGroupSize.
130constexpr char ReqdWorkGroupSize[] = "ReqdWorkGroupSize";
131/// Key for Kernel::Attr::Metadata::mWorkGroupSizeHint.
132constexpr char WorkGroupSizeHint[] = "WorkGroupSizeHint";
133/// Key for Kernel::Attr::Metadata::mVecTypeHint.
134constexpr char VecTypeHint[] = "VecTypeHint";
135/// Key for Kernel::Attr::Metadata::mRuntimeHandle.
136constexpr char RuntimeHandle[] = "RuntimeHandle";
137} // end namespace Key
138
139/// In-memory representation of kernel attributes metadata.
140struct Metadata final {
141 /// 'reqd_work_group_size' attribute. Optional.
142 std::vector<uint32_t> mReqdWorkGroupSize = std::vector<uint32_t>();
143 /// 'work_group_size_hint' attribute. Optional.
144 std::vector<uint32_t> mWorkGroupSizeHint = std::vector<uint32_t>();
145 /// 'vec_type_hint' attribute. Optional.
146 std::string mVecTypeHint = std::string();
147 /// External symbol created by runtime to store the kernel address
148 /// for enqueued blocks.
149 std::string mRuntimeHandle = std::string();
150
151 /// Default constructor.
152 Metadata() = default;
153
154 /// \returns True if kernel attributes metadata is empty, false otherwise.
155 bool empty() const {
156 return !notEmpty();
157 }
158
159 /// \returns True if kernel attributes metadata is not empty, false otherwise.
160 bool notEmpty() const {
161 return !mReqdWorkGroupSize.empty() || !mWorkGroupSizeHint.empty() ||
162 !mVecTypeHint.empty() || !mRuntimeHandle.empty();
163 }
164};
165
166} // end namespace Attrs
167
168//===----------------------------------------------------------------------===//
169// Kernel Argument Metadata.
170//===----------------------------------------------------------------------===//
171namespace Arg {
172
173namespace Key {
174/// Key for Kernel::Arg::Metadata::mName.
175constexpr char Name[] = "Name";
176/// Key for Kernel::Arg::Metadata::mTypeName.
177constexpr char TypeName[] = "TypeName";
178/// Key for Kernel::Arg::Metadata::mSize.
179constexpr char Size[] = "Size";
180/// Key for Kernel::Arg::Metadata::mOffset.
181constexpr char Offset[] = "Offset";
182/// Key for Kernel::Arg::Metadata::mAlign.
183constexpr char Align[] = "Align";
184/// Key for Kernel::Arg::Metadata::mValueKind.
185constexpr char ValueKind[] = "ValueKind";
186/// Key for Kernel::Arg::Metadata::mValueType. (deprecated)
187constexpr char ValueType[] = "ValueType";
188/// Key for Kernel::Arg::Metadata::mPointeeAlign.
189constexpr char PointeeAlign[] = "PointeeAlign";
190/// Key for Kernel::Arg::Metadata::mAddrSpaceQual.
191constexpr char AddrSpaceQual[] = "AddrSpaceQual";
192/// Key for Kernel::Arg::Metadata::mAccQual.
193constexpr char AccQual[] = "AccQual";
194/// Key for Kernel::Arg::Metadata::mActualAccQual.
195constexpr char ActualAccQual[] = "ActualAccQual";
196/// Key for Kernel::Arg::Metadata::mIsConst.
197constexpr char IsConst[] = "IsConst";
198/// Key for Kernel::Arg::Metadata::mIsRestrict.
199constexpr char IsRestrict[] = "IsRestrict";
200/// Key for Kernel::Arg::Metadata::mIsVolatile.
201constexpr char IsVolatile[] = "IsVolatile";
202/// Key for Kernel::Arg::Metadata::mIsPipe.
203constexpr char IsPipe[] = "IsPipe";
204} // end namespace Key
205
206/// In-memory representation of kernel argument metadata.
207struct Metadata final {
208 /// Name. Optional.
209 std::string mName = std::string();
210 /// Type name. Optional.
211 std::string mTypeName = std::string();
212 /// Size in bytes. Required.
214 /// Offset in bytes. Required for code object v3, unused for code object v2.
216 /// Alignment in bytes. Required.
218 /// Value kind. Required.
220 /// Pointee alignment in bytes. Optional.
222 /// Address space qualifier. Optional.
224 /// Access qualifier. Optional.
226 /// Actual access qualifier. Optional.
228 /// True if 'const' qualifier is specified. Optional.
229 bool mIsConst = false;
230 /// True if 'restrict' qualifier is specified. Optional.
231 bool mIsRestrict = false;
232 /// True if 'volatile' qualifier is specified. Optional.
233 bool mIsVolatile = false;
234 /// True if 'pipe' qualifier is specified. Optional.
235 bool mIsPipe = false;
236
237 /// Default constructor.
238 Metadata() = default;
239};
240
241} // end namespace Arg
242
243//===----------------------------------------------------------------------===//
244// Kernel Code Properties Metadata.
245//===----------------------------------------------------------------------===//
246namespace CodeProps {
247
248namespace Key {
249/// Key for Kernel::CodeProps::Metadata::mKernargSegmentSize.
250constexpr char KernargSegmentSize[] = "KernargSegmentSize";
251/// Key for Kernel::CodeProps::Metadata::mGroupSegmentFixedSize.
252constexpr char GroupSegmentFixedSize[] = "GroupSegmentFixedSize";
253/// Key for Kernel::CodeProps::Metadata::mPrivateSegmentFixedSize.
254constexpr char PrivateSegmentFixedSize[] = "PrivateSegmentFixedSize";
255/// Key for Kernel::CodeProps::Metadata::mKernargSegmentAlign.
256constexpr char KernargSegmentAlign[] = "KernargSegmentAlign";
257/// Key for Kernel::CodeProps::Metadata::mWavefrontSize.
258constexpr char WavefrontSize[] = "WavefrontSize";
259/// Key for Kernel::CodeProps::Metadata::mNumSGPRs.
260constexpr char NumSGPRs[] = "NumSGPRs";
261/// Key for Kernel::CodeProps::Metadata::mNumVGPRs.
262constexpr char NumVGPRs[] = "NumVGPRs";
263/// Key for Kernel::CodeProps::Metadata::mMaxFlatWorkGroupSize.
264constexpr char MaxFlatWorkGroupSize[] = "MaxFlatWorkGroupSize";
265/// Key for Kernel::CodeProps::Metadata::mIsDynamicCallStack.
266constexpr char IsDynamicCallStack[] = "IsDynamicCallStack";
267/// Key for Kernel::CodeProps::Metadata::mIsXNACKEnabled.
268constexpr char IsXNACKEnabled[] = "IsXNACKEnabled";
269/// Key for Kernel::CodeProps::Metadata::mNumSpilledSGPRs.
270constexpr char NumSpilledSGPRs[] = "NumSpilledSGPRs";
271/// Key for Kernel::CodeProps::Metadata::mNumSpilledVGPRs.
272constexpr char NumSpilledVGPRs[] = "NumSpilledVGPRs";
273} // end namespace Key
274
275/// In-memory representation of kernel code properties metadata.
276struct Metadata final {
277 /// Size in bytes of the kernarg segment memory. Kernarg segment memory
278 /// holds the values of the arguments to the kernel. Required.
280 /// Size in bytes of the group segment memory required by a workgroup.
281 /// This value does not include any dynamically allocated group segment memory
282 /// that may be added when the kernel is dispatched. Required.
284 /// Size in bytes of the private segment memory required by a workitem.
285 /// Private segment memory includes arg, spill and private segments. Required.
287 /// Maximum byte alignment of variables used by the kernel in the
288 /// kernarg memory segment. Required.
290 /// Wavefront size. Required.
292 /// Total number of SGPRs used by a wavefront. Optional.
294 /// Total number of VGPRs used by a workitem. Optional.
296 /// Maximum flat work-group size supported by the kernel. Optional.
298 /// True if the generated machine code is using a dynamically sized
299 /// call stack. Optional.
301 /// True if the generated machine code is capable of supporting XNACK.
302 /// Optional.
303 bool mIsXNACKEnabled = false;
304 /// Number of SGPRs spilled by a wavefront. Optional.
306 /// Number of VGPRs spilled by a workitem. Optional.
308
309 /// Default constructor.
310 Metadata() = default;
311
312 /// \returns True if kernel code properties metadata is empty, false
313 /// otherwise.
314 bool empty() const {
315 return !notEmpty();
316 }
317
318 /// \returns True if kernel code properties metadata is not empty, false
319 /// otherwise.
320 bool notEmpty() const {
321 return true;
322 }
323};
324
325} // end namespace CodeProps
326
327//===----------------------------------------------------------------------===//
328// Kernel Debug Properties Metadata.
329//===----------------------------------------------------------------------===//
330namespace DebugProps {
331
332namespace Key {
333/// Key for Kernel::DebugProps::Metadata::mDebuggerABIVersion.
334constexpr char DebuggerABIVersion[] = "DebuggerABIVersion";
335/// Key for Kernel::DebugProps::Metadata::mReservedNumVGPRs.
336constexpr char ReservedNumVGPRs[] = "ReservedNumVGPRs";
337/// Key for Kernel::DebugProps::Metadata::mReservedFirstVGPR.
338constexpr char ReservedFirstVGPR[] = "ReservedFirstVGPR";
339/// Key for Kernel::DebugProps::Metadata::mPrivateSegmentBufferSGPR.
340constexpr char PrivateSegmentBufferSGPR[] = "PrivateSegmentBufferSGPR";
341/// Key for
342/// Kernel::DebugProps::Metadata::mWavefrontPrivateSegmentOffsetSGPR.
344 "WavefrontPrivateSegmentOffsetSGPR";
345} // end namespace Key
346
347/// In-memory representation of kernel debug properties metadata.
348struct Metadata final {
349 /// Debugger ABI version. Optional.
350 std::vector<uint32_t> mDebuggerABIVersion = std::vector<uint32_t>();
351 /// Consecutive number of VGPRs reserved for debugger use. Must be 0 if
352 /// mDebuggerABIVersion is not set. Optional.
354 /// First fixed VGPR reserved. Must be uint16_t(-1) if
355 /// mDebuggerABIVersion is not set or mReservedFirstVGPR is 0. Optional.
357 /// Fixed SGPR of the first of 4 SGPRs used to hold the scratch V# used
358 /// for the entire kernel execution. Must be uint16_t(-1) if
359 /// mDebuggerABIVersion is not set or SGPR not used or not known. Optional.
361 /// Fixed SGPR used to hold the wave scratch offset for the entire
362 /// kernel execution. Must be uint16_t(-1) if mDebuggerABIVersion is not set
363 /// or SGPR is not used or not known. Optional.
365
366 /// Default constructor.
367 Metadata() = default;
368
369 /// \returns True if kernel debug properties metadata is empty, false
370 /// otherwise.
371 bool empty() const {
372 return !notEmpty();
373 }
374
375 /// \returns True if kernel debug properties metadata is not empty, false
376 /// otherwise.
377 bool notEmpty() const {
378 return !mDebuggerABIVersion.empty();
379 }
380};
381
382} // end namespace DebugProps
383
384namespace Key {
385/// Key for Kernel::Metadata::mName.
386constexpr char Name[] = "Name";
387/// Key for Kernel::Metadata::mSymbolName.
388constexpr char SymbolName[] = "SymbolName";
389/// Key for Kernel::Metadata::mLanguage.
390constexpr char Language[] = "Language";
391/// Key for Kernel::Metadata::mLanguageVersion.
392constexpr char LanguageVersion[] = "LanguageVersion";
393/// Key for Kernel::Metadata::mAttrs.
394constexpr char Attrs[] = "Attrs";
395/// Key for Kernel::Metadata::mArgs.
396constexpr char Args[] = "Args";
397/// Key for Kernel::Metadata::mCodeProps.
398constexpr char CodeProps[] = "CodeProps";
399/// Key for Kernel::Metadata::mDebugProps.
400constexpr char DebugProps[] = "DebugProps";
401} // end namespace Key
402
403/// In-memory representation of kernel metadata.
404struct Metadata final {
405 /// Kernel source name. Required.
406 std::string mName = std::string();
407 /// Kernel descriptor name. Required.
408 std::string mSymbolName = std::string();
409 /// Language. Optional.
410 std::string mLanguage = std::string();
411 /// Language version. Optional.
412 std::vector<uint32_t> mLanguageVersion = std::vector<uint32_t>();
413 /// Attributes metadata. Optional.
415 /// Arguments metadata. Optional.
416 std::vector<Arg::Metadata> mArgs = std::vector<Arg::Metadata>();
417 /// Code properties metadata. Optional.
419 /// Debug properties metadata. Optional.
421
422 /// Default constructor.
423 Metadata() = default;
424};
425
426} // end namespace Kernel
427
428namespace Key {
429/// Key for HSA::Metadata::mVersion.
430constexpr char Version[] = "Version";
431/// Key for HSA::Metadata::mPrintf.
432constexpr char Printf[] = "Printf";
433/// Key for HSA::Metadata::mKernels.
434constexpr char Kernels[] = "Kernels";
435} // end namespace Key
436
437/// In-memory representation of HSA metadata.
438struct Metadata final {
439 /// HSA metadata version. Required.
440 std::vector<uint32_t> mVersion = std::vector<uint32_t>();
441 /// Printf metadata. Optional.
442 std::vector<std::string> mPrintf = std::vector<std::string>();
443 /// Kernels metadata. Required.
444 std::vector<Kernel::Metadata> mKernels = std::vector<Kernel::Metadata>();
445
446 /// Default constructor.
447 Metadata() = default;
448};
449
450/// Converts \p String to \p HSAMetadata.
451LLVM_ABI std::error_code fromString(StringRef String, Metadata &HSAMetadata);
452
453/// Converts \p HSAMetadata to \p String.
454LLVM_ABI std::error_code toString(Metadata HSAMetadata, std::string &String);
455
456//===----------------------------------------------------------------------===//
457// HSA metadata for v3 code object.
458//===----------------------------------------------------------------------===//
459namespace V3 {
460/// HSA metadata major version.
461constexpr uint32_t VersionMajor = 1;
462/// HSA metadata minor version.
463constexpr uint32_t VersionMinor = 0;
464
465/// HSA metadata beginning assembler directive.
466constexpr char AssemblerDirectiveBegin[] = ".amdgpu_metadata";
467/// HSA metadata ending assembler directive.
468constexpr char AssemblerDirectiveEnd[] = ".end_amdgpu_metadata";
469} // end namespace V3
470
471} // end namespace HSAMD
472
473//===----------------------------------------------------------------------===//
474// PAL metadata.
475//===----------------------------------------------------------------------===//
476namespace PALMD {
477
478/// PAL metadata (old linear format) assembler directive.
479constexpr char AssemblerDirective[] = ".amd_amdgpu_pal_metadata";
480
481/// PAL metadata (new MsgPack format) beginning assembler directive.
482constexpr char AssemblerDirectiveBegin[] = ".amdgpu_pal_metadata";
483
484/// PAL metadata (new MsgPack format) ending assembler directive.
485constexpr char AssemblerDirectiveEnd[] = ".end_amdgpu_pal_metadata";
486
487/// PAL metadata keys.
488enum Key : uint32_t {
501
502 LS_NUM_USED_VGPRS = 0x10000021,
503 HS_NUM_USED_VGPRS = 0x10000022,
504 ES_NUM_USED_VGPRS = 0x10000023,
505 GS_NUM_USED_VGPRS = 0x10000024,
506 VS_NUM_USED_VGPRS = 0x10000025,
507 PS_NUM_USED_VGPRS = 0x10000026,
508 CS_NUM_USED_VGPRS = 0x10000027,
509
510 LS_NUM_USED_SGPRS = 0x10000028,
511 HS_NUM_USED_SGPRS = 0x10000029,
512 ES_NUM_USED_SGPRS = 0x1000002a,
513 GS_NUM_USED_SGPRS = 0x1000002b,
514 VS_NUM_USED_SGPRS = 0x1000002c,
515 PS_NUM_USED_SGPRS = 0x1000002d,
516 CS_NUM_USED_SGPRS = 0x1000002e,
517
518 LS_SCRATCH_SIZE = 0x10000044,
519 HS_SCRATCH_SIZE = 0x10000045,
520 ES_SCRATCH_SIZE = 0x10000046,
521 GS_SCRATCH_SIZE = 0x10000047,
522 VS_SCRATCH_SIZE = 0x10000048,
523 PS_SCRATCH_SIZE = 0x10000049,
524 CS_SCRATCH_SIZE = 0x1000004a
526
527} // end namespace PALMD
528} // end namespace AMDGPU
529} // end namespace llvm
530
531#endif // LLVM_SUPPORT_AMDGPUMETADATA_H
#define LLVM_ABI
Definition: Compiler.h:213
This is an important base class in LLVM.
Definition: Constant.h:43
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
constexpr char AddrSpaceQual[]
Key for Kernel::Arg::Metadata::mAddrSpaceQual.
constexpr char IsVolatile[]
Key for Kernel::Arg::Metadata::mIsVolatile.
constexpr char PointeeAlign[]
Key for Kernel::Arg::Metadata::mPointeeAlign.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
constexpr char Offset[]
Key for Kernel::Arg::Metadata::mOffset.
constexpr char TypeName[]
Key for Kernel::Arg::Metadata::mTypeName.
constexpr char IsConst[]
Key for Kernel::Arg::Metadata::mIsConst.
constexpr char IsRestrict[]
Key for Kernel::Arg::Metadata::mIsRestrict.
constexpr char ActualAccQual[]
Key for Kernel::Arg::Metadata::mActualAccQual.
constexpr char AccQual[]
Key for Kernel::Arg::Metadata::mAccQual.
constexpr char IsPipe[]
Key for Kernel::Arg::Metadata::mIsPipe.
constexpr char Name[]
Key for Kernel::Arg::Metadata::mName.
constexpr char ReqdWorkGroupSize[]
Key for Kernel::Attr::Metadata::mReqdWorkGroupSize.
constexpr char VecTypeHint[]
Key for Kernel::Attr::Metadata::mVecTypeHint.
constexpr char RuntimeHandle[]
Key for Kernel::Attr::Metadata::mRuntimeHandle.
constexpr char WorkGroupSizeHint[]
Key for Kernel::Attr::Metadata::mWorkGroupSizeHint.
constexpr char NumVGPRs[]
Key for Kernel::CodeProps::Metadata::mNumVGPRs.
constexpr char NumSpilledSGPRs[]
Key for Kernel::CodeProps::Metadata::mNumSpilledSGPRs.
constexpr char IsXNACKEnabled[]
Key for Kernel::CodeProps::Metadata::mIsXNACKEnabled.
constexpr char NumSpilledVGPRs[]
Key for Kernel::CodeProps::Metadata::mNumSpilledVGPRs.
constexpr char KernargSegmentAlign[]
Key for Kernel::CodeProps::Metadata::mKernargSegmentAlign.
constexpr char IsDynamicCallStack[]
Key for Kernel::CodeProps::Metadata::mIsDynamicCallStack.
constexpr char NumSGPRs[]
Key for Kernel::CodeProps::Metadata::mNumSGPRs.
constexpr char KernargSegmentSize[]
Key for Kernel::CodeProps::Metadata::mKernargSegmentSize.
constexpr char WavefrontSize[]
Key for Kernel::CodeProps::Metadata::mWavefrontSize.
constexpr char MaxFlatWorkGroupSize[]
Key for Kernel::CodeProps::Metadata::mMaxFlatWorkGroupSize.
constexpr char GroupSegmentFixedSize[]
Key for Kernel::CodeProps::Metadata::mGroupSegmentFixedSize.
constexpr char PrivateSegmentFixedSize[]
Key for Kernel::CodeProps::Metadata::mPrivateSegmentFixedSize.
constexpr char ReservedFirstVGPR[]
Key for Kernel::DebugProps::Metadata::mReservedFirstVGPR.
constexpr char ReservedNumVGPRs[]
Key for Kernel::DebugProps::Metadata::mReservedNumVGPRs.
constexpr char DebuggerABIVersion[]
Key for Kernel::DebugProps::Metadata::mDebuggerABIVersion.
constexpr char PrivateSegmentBufferSGPR[]
Key for Kernel::DebugProps::Metadata::mPrivateSegmentBufferSGPR.
constexpr char WavefrontPrivateSegmentOffsetSGPR[]
Key for Kernel::DebugProps::Metadata::mWavefrontPrivateSegmentOffsetSGPR.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
constexpr char CodeProps[]
Key for Kernel::Metadata::mCodeProps.
constexpr char Name[]
Key for Kernel::Metadata::mName.
constexpr char Language[]
Key for Kernel::Metadata::mLanguage.
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
constexpr char LanguageVersion[]
Key for Kernel::Metadata::mLanguageVersion.
constexpr char DebugProps[]
Key for Kernel::Metadata::mDebugProps.
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
constexpr char Version[]
Key for HSA::Metadata::mVersion.
constexpr char Printf[]
Key for HSA::Metadata::mPrintf.
constexpr char Kernels[]
Key for HSA::Metadata::mKernels.
constexpr char AssemblerDirectiveBegin[]
HSA metadata beginning assembler directive.
constexpr uint32_t VersionMinor
HSA metadata minor version.
constexpr uint32_t VersionMajor
HSA metadata major version.
constexpr char AssemblerDirectiveEnd[]
HSA metadata ending assembler directive.
LLVM_ABI std::error_code fromString(StringRef String, Metadata &HSAMetadata)
Converts String to HSAMetadata.
constexpr char AssemblerDirectiveBegin[]
Old HSA metadata beginning assembler directive for V2.
constexpr uint32_t VersionMajorV5
HSA metadata major version for code object V5.
constexpr uint32_t VersionMinorV4
HSA metadata minor version for code object V4.
AddressSpaceQualifier
Address space qualifiers.
ValueKind
Value kinds.
LLVM_ABI std::error_code toString(Metadata HSAMetadata, std::string &String)
Converts HSAMetadata to String.
constexpr uint32_t VersionMajorV3
HSA metadata major version for code object V3.
constexpr uint32_t VersionMinorV5
HSA metadata minor version for code object V5.
constexpr uint32_t VersionMinorV3
HSA metadata minor version for code object V3.
constexpr uint32_t VersionMinorV6
HSA metadata minor version for code object V6.
constexpr uint32_t VersionMajorV6
HSA metadata major version for code object V6.
AccessQualifier
Access qualifiers.
constexpr uint32_t VersionMajorV4
HSA metadata major version for code object V4.
constexpr char AssemblerDirective[]
PAL metadata (old linear format) assembler directive.
constexpr char AssemblerDirectiveBegin[]
PAL metadata (new MsgPack format) beginning assembler directive.
constexpr char AssemblerDirectiveEnd[]
PAL metadata (new MsgPack format) ending assembler directive.
Key
PAL metadata keys.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
In-memory representation of kernel argument metadata.
AccessQualifier mActualAccQual
Actual access qualifier. Optional.
uint32_t mAlign
Alignment in bytes. Required.
uint32_t mOffset
Offset in bytes. Required for code object v3, unused for code object v2.
Metadata()=default
Default constructor.
uint32_t mPointeeAlign
Pointee alignment in bytes. Optional.
bool mIsVolatile
True if 'volatile' qualifier is specified. Optional.
ValueKind mValueKind
Value kind. Required.
bool mIsConst
True if 'const' qualifier is specified. Optional.
bool mIsRestrict
True if 'restrict' qualifier is specified. Optional.
bool mIsPipe
True if 'pipe' qualifier is specified. Optional.
AddressSpaceQualifier mAddrSpaceQual
Address space qualifier. Optional.
uint32_t mSize
Size in bytes. Required.
AccessQualifier mAccQual
Access qualifier. Optional.
std::string mTypeName
Type name. Optional.
In-memory representation of kernel attributes metadata.
std::string mRuntimeHandle
External symbol created by runtime to store the kernel address for enqueued blocks.
Metadata()=default
Default constructor.
std::string mVecTypeHint
'vec_type_hint' attribute. Optional.
std::vector< uint32_t > mReqdWorkGroupSize
'reqd_work_group_size' attribute. Optional.
std::vector< uint32_t > mWorkGroupSizeHint
'work_group_size_hint' attribute. Optional.
In-memory representation of kernel code properties metadata.
uint16_t mNumSGPRs
Total number of SGPRs used by a wavefront. Optional.
uint64_t mKernargSegmentSize
Size in bytes of the kernarg segment memory.
uint32_t mGroupSegmentFixedSize
Size in bytes of the group segment memory required by a workgroup.
uint32_t mKernargSegmentAlign
Maximum byte alignment of variables used by the kernel in the kernarg memory segment.
uint16_t mNumSpilledSGPRs
Number of SGPRs spilled by a wavefront. Optional.
bool mIsXNACKEnabled
True if the generated machine code is capable of supporting XNACK.
uint32_t mWavefrontSize
Wavefront size. Required.
uint16_t mNumSpilledVGPRs
Number of VGPRs spilled by a workitem. Optional.
uint16_t mNumVGPRs
Total number of VGPRs used by a workitem. Optional.
bool mIsDynamicCallStack
True if the generated machine code is using a dynamically sized call stack.
uint32_t mPrivateSegmentFixedSize
Size in bytes of the private segment memory required by a workitem.
uint32_t mMaxFlatWorkGroupSize
Maximum flat work-group size supported by the kernel. Optional.
In-memory representation of kernel debug properties metadata.
uint16_t mPrivateSegmentBufferSGPR
Fixed SGPR of the first of 4 SGPRs used to hold the scratch V# used for the entire kernel execution.
uint16_t mReservedFirstVGPR
First fixed VGPR reserved.
std::vector< uint32_t > mDebuggerABIVersion
Debugger ABI version. Optional.
uint16_t mWavefrontPrivateSegmentOffsetSGPR
Fixed SGPR used to hold the wave scratch offset for the entire kernel execution.
uint16_t mReservedNumVGPRs
Consecutive number of VGPRs reserved for debugger use.
In-memory representation of kernel metadata.
Metadata()=default
Default constructor.
DebugProps::Metadata mDebugProps
Debug properties metadata. Optional.
Attrs::Metadata mAttrs
Attributes metadata. Optional.
std::string mLanguage
Language. Optional.
std::string mName
Kernel source name. Required.
std::vector< Arg::Metadata > mArgs
Arguments metadata. Optional.
CodeProps::Metadata mCodeProps
Code properties metadata. Optional.
std::vector< uint32_t > mLanguageVersion
Language version. Optional.
std::string mSymbolName
Kernel descriptor name. Required.
In-memory representation of HSA metadata.
std::vector< Kernel::Metadata > mKernels
Kernels metadata. Required.
Metadata()=default
Default constructor.
std::vector< uint32_t > mVersion
HSA metadata version. Required.
std::vector< std::string > mPrintf
Printf metadata. Optional.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39