18 mlir::complex::ComplexDialect)
21 return isa<complex::NumberAttr>(
unwrap(attr));
25 double real,
double imag) {
27 complex::NumberAttr::get(cast<ComplexType>(
unwrap(type)), real, imag));
31 double real,
double imag) {
32 return wrap(complex::NumberAttr::getChecked(
33 unwrap(loc), cast<ComplexType>(
unwrap(type)), real, imag));
37 return cast<complex::NumberAttr>(
unwrap(attr)).getReal().convertToDouble();
41 return cast<complex::NumberAttr>(
unwrap(attr)).getImag().convertToDouble();
45 return wrap(complex::NumberAttr::getTypeID());
double mlirComplexAttrGetImagDouble(MlirAttribute attr)
Returns the imaginaryvalue stored in the given complex attribute, interpreting the value as double.
MlirAttribute mlirComplexAttrDoubleGetChecked(MlirLocation loc, MlirType type, double real, double imag)
Same as "mlirComplexAttrDoubleGet", but if the type is not valid for a construction of a ComplexAttr,...
double mlirComplexAttrGetRealDouble(MlirAttribute attr)
Returns the real value stored in the given complex attribute, interpreting the value as double.
MlirAttribute mlirComplexAttrDoubleGet(MlirContext ctx, MlirType type, double real, double imag)
Creates a complex attribute in the given context with the given double real and imaginary values and ...
MlirTypeID mlirComplexAttrGetTypeID(void)
Returns the typeID of a Complex attribute.
#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
MLIR_CAPI_EXPORTED bool mlirAttributeIsAComplex(MlirAttribute attr)
Checks whether the given attribute is a complex attribute.
Include the generated interface declarations.