MLIR 22.0.0git
Complex.h
Go to the documentation of this file.
1//===-- mlir-c/Dialect/Complex.h - C API for Complex dialect ------*- C -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM
4// Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef MLIR_C_DIALECT_COMPLEX_H
11#define MLIR_C_DIALECT_COMPLEX_H
12
13#include "mlir-c/IR.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
20
21/// Checks whether the given attribute is a complex attribute.
23
24/// Creates a complex attribute in the given context with the given
25/// double real and imaginary values and double-precision FP semantics.
26MLIR_CAPI_EXPORTED MlirAttribute mlirComplexAttrDoubleGet(MlirContext ctx,
27 MlirType type,
28 double real,
29 double imag);
30
31/// Same as "mlirComplexAttrDoubleGet", but if the type is not valid for a
32/// construction of a ComplexAttr, returns a null MlirAttribute.
34 MlirLocation loc, MlirType type, double real, double imag);
35
36/// Returns the real value stored in the given complex attribute, interpreting
37/// the value as double.
38MLIR_CAPI_EXPORTED double mlirComplexAttrGetRealDouble(MlirAttribute attr);
39
40/// Returns the imaginaryvalue stored in the given complex attribute,
41/// interpreting the value as double.
42MLIR_CAPI_EXPORTED double mlirComplexAttrGetImagDouble(MlirAttribute attr);
43
44/// Returns the typeID of a Complex attribute.
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif // MLIR_C_DIALECT_COMPLEX_H
MLIR_CAPI_EXPORTED double mlirComplexAttrGetRealDouble(MlirAttribute attr)
Returns the real value stored in the given complex attribute, interpreting the value as double.
Definition Complex.cpp:36
MLIR_CAPI_EXPORTED bool mlirAttributeIsAComplex(MlirAttribute attr)
Checks whether the given attribute is a complex attribute.
MLIR_CAPI_EXPORTED 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,...
Definition Complex.cpp:30
MLIR_CAPI_EXPORTED double mlirComplexAttrGetImagDouble(MlirAttribute attr)
Returns the imaginaryvalue stored in the given complex attribute, interpreting the value as double.
Definition Complex.cpp:40
MLIR_CAPI_EXPORTED 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 ...
Definition Complex.cpp:24
MLIR_CAPI_EXPORTED MlirTypeID mlirComplexAttrGetTypeID(void)
Returns the typeID of a Complex attribute.
Definition Complex.cpp:44
#define MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Name, Namespace)
Definition IR.h:215
#define MLIR_CAPI_EXPORTED
Definition Support.h:46