LLVM 20.0.0git
|
Classes | |
struct | AMDGPUKernelMetaData |
Struct for holding metadata related to AMDGPU kernels, for more information about the metadata and its meaning see: https://llvm.org/docs/AMDGPUUsage.html#code-object-v3. More... | |
Functions | |
bool | isImageCompatibleWithEnv (StringRef ImageArch, uint32_t ImageFlags, StringRef EnvTargetID) |
Check if an image is compatible with current system's environment. | |
Error | getAMDGPUMetaDataFromImage (MemoryBufferRef MemBuffer, StringMap< AMDGPUKernelMetaData > &KernelInfoMap, uint16_t &ELFABIVersion) |
Reads AMDGPU specific metadata from the ELF file and propagates the KernelInfoMap. | |
Error llvm::offloading::amdgpu::getAMDGPUMetaDataFromImage | ( | MemoryBufferRef | MemBuffer, |
StringMap< AMDGPUKernelMetaData > & | KernelInfoMap, | ||
uint16_t & | ELFABIVersion | ||
) |
Reads AMDGPU specific metadata from the ELF file and propagates the KernelInfoMap.
Definition at line 328 of file Utility.cpp.
References llvm::object::ELFFile< ELFT >::create(), llvm::ELF::EI_ABIVERSION, llvm::MemoryBufferRef::getBuffer(), llvm::object::ELFFile< ELFT >::getHeader(), N, llvm::object::ELFFile< ELFT >::notes(), llvm::object::ELFFile< ELFT >::sections(), llvm::ELF::SHT_NOTE, llvm::Error::success(), and llvm::Expected< T >::takeError().
bool llvm::offloading::amdgpu::isImageCompatibleWithEnv | ( | StringRef | ImageArch, |
uint32_t | ImageFlags, | ||
StringRef | EnvTargetID | ||
) |
Check if an image is compatible with current system's environment.
The system environment is given as a 'target-id' which has the form:
<target-id> := <processor> ( ":" <target-feature> ( "+" | "-" ) )*
If a feature is not specific as '+' or '-' it is assumed to be in an 'any' and is compatible with either '+' or '-'. The HSA runtime returns this information using the target-id, while we use the ELF header to determine these features.
Definition at line 136 of file Utility.cpp.
References llvm::StringRef::contains(), and llvm::StringRef::split().