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