9#ifndef LLVM_FRONTEND_OFFLOADING_UTILITY_H
10#define LLVM_FRONTEND_OFFLOADING_UTILITY_H
91std::pair<Constant *, GlobalVariable *>
98std::pair<GlobalVariable *, GlobalVariable *>
120 std::numeric_limits<uint32_t>::max();
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.
Error getAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer, StringMap< AMDGPUKernelMetaData > &KernelInfoMap, uint16_t &ELFABIVersion)
Reads AMDGPU specific metadata from the ELF file and propagates the KernelInfoMap.
bool isImageCompatibleWithEnv(StringRef ImageArch, uint32_t ImageFlags, StringRef EnvTargetID)
Check if an image is compatible with current system's environment.
void emitOffloadingEntry(Module &M, object::OffloadKind Kind, Constant *Addr, StringRef Name, uint64_t Size, uint32_t Flags, uint64_t Data, StringRef SectionName, Constant *AuxAddr=nullptr)
Create an offloading section struct used to register this global at runtime.
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.
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.
@ OffloadGlobalSurfaceEntry
Mark the entry as a surface variable.
@ OffloadGlobalTextureEntry
Mark the entry as a texture variable.
@ OffloadGlobalNormalized
Mark the entry as being a normalized surface.
@ OffloadGlobalEntry
Mark the entry as a global entry.
@ OffloadGlobalManagedEntry
Mark the entry as a managed global variable.
@ OffloadGlobalExtern
Mark the entry as being extern.
@ OffloadGlobalConstant
Mark the entry as being constant.
std::pair< GlobalVariable *, GlobalVariable * > getOffloadEntryArray(Module &M, StringRef SectionName)
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.
This is the record of an object that just be registered with the offloading runtime.
void * Address
The address of the global to be registered by the runtime.
uint64_t Size
The number of bytes the symbol takes.
uint16_t Kind
The expected consumer of this entry, e.g. CUDA or OpenMP.
char * SymbolName
The name of the symbol in the device image.
uint32_t Flags
Flags associated with the global.
uint64_t Reserved
Reserved bytes used to detect an older version of the struct, always zero.
uint16_t Version
The current version of the struct for runtime forward compatibility.
void * AuxAddr
An extra pointer, usually null.
uint64_t Data
Extra generic data used to register this entry.