llvm::offloading::amdgpu::isImageCompatibleWithEnv

Check if an image is compatible with current system's environment. The system environment is given as a 'target-id' which has the form:

Synopsis

Declared in <llvm/Frontend/Offloading/Utility.h>

bool
isImageCompatibleWithEnv(
    StringRef ImageArch,
    uint32_t ImageFlags,
    StringRef EnvTargetID);

Description

<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.

Return Value

True if the image is compatible with the given environment.

Parameters

NameDescription
ImageArchProcessor architecture of the image.
ImageFlagsELF feature flags of the image.
EnvTargetIDTarget-id describing the system's environment.