13 #ifndef MLIR_DIALECT_TOSA_IR_TARGETENV_H
14 #define MLIR_DIALECT_TOSA_IR_TARGETENV_H
18 #include "llvm/ADT/SmallSet.h"
30 enabledProfiles.insert_range(profiles);
32 enabledExtensions.insert_range(extensions);
35 void addProfile(Profile p) { enabledProfiles.insert(p); }
43 bool allows(Profile prof)
const {
return enabledProfiles.count(prof) != 0; }
46 return llvm::any_of(profs, [&](Profile prof) {
return allows(prof); });
50 return llvm::all_of(profs, [&](Profile prof) {
return allows(prof); });
54 bool allows(Extension ext)
const {
return enabledExtensions.count(ext) != 0; }
57 return llvm::any_of(exts, [&](Extension ext) {
return allows(ext); });
61 return llvm::all_of(exts, [&](Extension ext) {
return allows(ext); });
65 llvm::SmallSet<Profile, 3> enabledProfiles;
66 llvm::SmallSet<Extension, 8> enabledExtensions;
This class represents the capability enabled in the target implementation such as profile,...
void addExtension(Extension e)
bool allowsAllOf(ArrayRef< Extension > exts) const
TargetEnv(const SmallVectorImpl< Profile > &profiles, const SmallVectorImpl< Extension > &extensions)
void addProfile(Profile p)
bool allowsAllOf(ArrayRef< Profile > profs) const
bool allows(Profile prof) const
bool allows(Extension ext) const
bool allowsAnyOf(ArrayRef< Profile > profs) const
bool allowsAnyOf(ArrayRef< Extension > exts) const
Include the generated interface declarations.