LLVM 20.0.0git
Classes | Functions
llvm::offloading::amdgpu Namespace Reference

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.
 

Function Documentation

◆ getAMDGPUMetaDataFromImage()

Error llvm::offloading::amdgpu::getAMDGPUMetaDataFromImage ( MemoryBufferRef  MemBuffer,
StringMap< AMDGPUKernelMetaData > &  KernelInfoMap,
uint16_t ELFABIVersion 
)

◆ isImageCompatibleWithEnv()

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 143 of file Utility.cpp.

References llvm::StringRef::contains(), and llvm::StringRef::split().