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