12 #include "llvm/Support/Casting.h"
23 return llvm::isa<gpu::ObjectAttr>(
unwrap(attr));
28 MlirAttribute mlirObjectProps) {
30 llvm::StringRef
object =
unwrap(objectStrRef);
31 DictionaryAttr objectProps;
32 if (mlirObjectProps.ptr !=
nullptr)
33 objectProps = llvm::cast<DictionaryAttr>(
unwrap(mlirObjectProps));
35 static_cast<gpu::CompilationTarget
>(format),
40 gpu::ObjectAttr objectAttr =
41 llvm::cast<gpu::ObjectAttr>(
unwrap(mlirObjectAttr));
42 return wrap(objectAttr.getTarget());
46 gpu::ObjectAttr objectAttr =
47 llvm::cast<gpu::ObjectAttr>(
unwrap(mlirObjectAttr));
48 return static_cast<uint32_t
>(objectAttr.getFormat());
52 gpu::ObjectAttr objectAttr =
53 llvm::cast<gpu::ObjectAttr>(
unwrap(mlirObjectAttr));
54 llvm::StringRef
object = objectAttr.getObject();
59 gpu::ObjectAttr objectAttr =
60 llvm::cast<gpu::ObjectAttr>(
unwrap(mlirObjectAttr));
61 return objectAttr.getProperties() !=
nullptr;
65 gpu::ObjectAttr objectAttr =
66 llvm::cast<gpu::ObjectAttr>(
unwrap(mlirObjectAttr));
67 return wrap(objectAttr.getProperties());
MlirAttribute mlirGPUObjectAttrGetProperties(MlirAttribute mlirObjectAttr)
MlirAttribute mlirGPUObjectAttrGetTarget(MlirAttribute mlirObjectAttr)
bool mlirAttributeIsAGPUObjectAttr(MlirAttribute attr)
MlirAttribute mlirGPUObjectAttrGet(MlirContext mlirCtx, MlirAttribute target, uint32_t format, MlirStringRef objectStrRef, MlirAttribute mlirObjectProps)
uint32_t mlirGPUObjectAttrGetFormat(MlirAttribute mlirObjectAttr)
bool mlirGPUObjectAttrHasProperties(MlirAttribute mlirObjectAttr)
MlirStringRef mlirGPUObjectAttrGetObject(MlirAttribute mlirObjectAttr)
#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
MLIRContext is the top-level object for a collection of MLIR operations.
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
static MlirStringRef mlirStringRefCreate(const char *str, size_t length)
Constructs a string reference from the pointer and length.
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
A pointer to a sized fragment of a string, not necessarily null-terminated.