LLVM: include/llvm/Frontend/Offloading/Utility.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_FRONTEND_OFFLOADING_UTILITY_H
10#define LLVM_FRONTEND_OFFLOADING_UTILITY_H
11
13#include
14#include
15
22
23namespace llvm {
25
26
27
29
31
33
35
37
39
41
43
45
47};
48
49
50
52
53
55
57
59
61
63
65
67};
68
69
70
72
73
74
75
76
77
78
79
80
81
82
83
84
85
91
92
93
94
95LLVM_ABI std::pair<Constant *, GlobalVariable *>
99
100
101
102LLVM_ABI std::pair<GlobalVariable *, GlobalVariable *>
104
106
107
108
109
110
111
112
113
114
117
118
119
120
122
124 std::numeric_limits<uint32_t>::max();
125
127
128
130
132
134
135
137
138
140
142
145
147
149
151};
152
153
154
158}
159
166}
167}
168
169#endif
This file defines the StringMap class.
Module.h This file contains the declarations for the Module class.
This is an important base class in LLVM.
Lightweight error class with error context and mandatory checking.
A Module instance is used to store all the information related to an LLVM module.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
Class to represent struct types.
OffloadKind
The producer of the associated offloading image.
LLVM_ABI Error getAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer, StringMap< AMDGPUKernelMetaData > &KernelInfoMap, uint16_t &ELFABIVersion)
Reads AMDGPU specific metadata from the ELF file and propagates the KernelInfoMap.
LLVM_ABI bool isImageCompatibleWithEnv(StringRef ImageArch, uint32_t ImageFlags, StringRef EnvTargetID)
Check if an image is compatible with current system's environment.
LLVM_ABI Error containerizeOpenMPSPIRVImage(std::unique_ptr< MemoryBuffer > &Binary)
Containerizes an offloading binary into the ELF binary format expected by the Intel runtime offload p...
LLVM_ABI GlobalVariable * emitOffloadingEntry(Module &M, object::OffloadKind Kind, Constant *Addr, StringRef Name, uint64_t Size, uint32_t Flags, uint64_t Data, Constant *AuxAddr=nullptr, StringRef SectionName="llvm_offload_entries")
Create an offloading section struct used to register this global at runtime.
LLVM_ABI std::pair< Constant *, GlobalVariable * > getOffloadingEntryInitializer(Module &M, object::OffloadKind Kind, Constant *Addr, StringRef Name, uint64_t Size, uint32_t Flags, uint64_t Data, Constant *AuxAddr)
Create a constant struct initializer used to register this global at runtime.
LLVM_ABI StructType * getEntryTy(Module &M)
Returns the type of the offloading entry we use to store kernels and globals that will be registered ...
OffloadEntryKindFlag
Offloading entry flags for CUDA / HIP.
Definition Utility.h:51
@ OffloadGlobalSurfaceEntry
Mark the entry as a surface variable.
Definition Utility.h:58
@ OffloadGlobalTextureEntry
Mark the entry as a texture variable.
Definition Utility.h:60
@ OffloadGlobalNormalized
Mark the entry as being a normalized surface.
Definition Utility.h:66
@ OffloadGlobalEntry
Mark the entry as a global entry.
Definition Utility.h:54
@ OffloadGlobalManagedEntry
Mark the entry as a managed global variable.
Definition Utility.h:56
@ OffloadGlobalExtern
Mark the entry as being extern.
Definition Utility.h:62
@ OffloadGlobalConstant
Mark the entry as being constant.
Definition Utility.h:64
LLVM_ABI std::pair< GlobalVariable *, GlobalVariable * > getOffloadEntryArray(Module &M, StringRef SectionName="llvm_offload_entries")
Creates a pair of globals used to iterate the array of offloading entries by accessing the section va...
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
This is the record of an object that just be registered with the offloading runtime.
Definition Utility.h:28
void * Address
The address of the global to be registered by the runtime.
Definition Utility.h:38
uint64_t Size
The number of bytes the symbol takes.
Definition Utility.h:42
uint16_t Kind
The expected consumer of this entry, e.g. CUDA or OpenMP.
Definition Utility.h:34
char * SymbolName
The name of the symbol in the device image.
Definition Utility.h:40
uint32_t Flags
Flags associated with the global.
Definition Utility.h:36
uint64_t Reserved
Reserved bytes used to detect an older version of the struct, always zero.
Definition Utility.h:30
uint16_t Version
The current version of the struct for runtime forward compatibility.
Definition Utility.h:32
void * AuxAddr
An extra pointer, usually null.
Definition Utility.h:46
uint64_t Data
Extra generic data used to register this entry.
Definition Utility.h:44