Commit 1e739552 authored by Alex Zinenko's avatar Alex Zinenko
Browse files

[mlir] Use more C99 comments in C API header files

These were left over from the original reformatting commit.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D95357
parent c3324450
Loading
Loading
Loading
Loading
+25 −26
Original line number Diff line number Diff line
@@ -17,17 +17,16 @@ extern "C" {
#endif

//===----------------------------------------------------------------------===//
/** Opaque type declarations.
 *
 * Types are exposed to C bindings as structs containing opaque pointers. They
 * are not supposed to be inspected from C. This allows the underlying
 * representation to change without affecting the API users. The use of structs
 * instead of typedefs enables some type safety as structs are not implicitly
 * convertible to each other.
 *
 * Instances of these types may or may not own the underlying object. The
 * ownership semantics is defined by how an instance of the type was obtained.
 */
// Opaque type declarations.
//
// Types are exposed to C bindings as structs containing opaque pointers. They
// are not supposed to be inspected from C. This allows the underlying
// representation to change without affecting the API users. The use of structs
// instead of typedefs enables some type safety as structs are not implicitly
// convertible to each other.
//
// Instances of these types may or may not own the underlying object. The
// ownership semantics is defined by how an instance of the type was obtained.
//===----------------------------------------------------------------------===//

#define DEFINE_C_API_STRUCT(name, storage)                                     \
@@ -54,9 +53,9 @@ inline static bool mlirAffineExprIsNull(MlirAffineExpr affineExpr) {
  return affineExpr.ptr == NULL;
}

/** Prints an affine expression by sending chunks of the string representation
 * and forwarding `userData to `callback`. Note that the callback may be called
 * several times with consecutive chunks of the string. */
/// Prints an affine expression by sending chunks of the string representation
/// and forwarding `userData to `callback`. Note that the callback may be called
/// several times with consecutive chunks of the string.
MLIR_CAPI_EXPORTED void mlirAffineExprPrint(MlirAffineExpr affineExpr,
                                            MlirStringCallback callback,
                                            void *userData);
@@ -64,17 +63,17 @@ MLIR_CAPI_EXPORTED void mlirAffineExprPrint(MlirAffineExpr affineExpr,
/// Prints the affine expression to the standard error stream.
MLIR_CAPI_EXPORTED void mlirAffineExprDump(MlirAffineExpr affineExpr);

/** Checks whether the given affine expression is made out of only symbols and
 * constants. */
/// Checks whether the given affine expression is made out of only symbols and
/// constants.
MLIR_CAPI_EXPORTED bool
mlirAffineExprIsSymbolicOrConstant(MlirAffineExpr affineExpr);

/** Checks whether the given affine expression is a pure affine expression, i.e.
 * mul, floordiv, ceildic, and mod is only allowed w.r.t constants. */
/// Checks whether the given affine expression is a pure affine expression, i.e.
/// mul, floordiv, ceildic, and mod is only allowed w.r.t constants.
MLIR_CAPI_EXPORTED bool mlirAffineExprIsPureAffine(MlirAffineExpr affineExpr);

/** Returns the greatest known integral divisor of this affine expression. The
 * result is always positive. */
/// Returns the greatest known integral divisor of this affine expression. The
/// result is always positive.
MLIR_CAPI_EXPORTED int64_t
mlirAffineExprGetLargestKnownDivisor(MlirAffineExpr affineExpr);

@@ -82,8 +81,8 @@ mlirAffineExprGetLargestKnownDivisor(MlirAffineExpr affineExpr);
MLIR_CAPI_EXPORTED bool mlirAffineExprIsMultipleOf(MlirAffineExpr affineExpr,
                                                   int64_t factor);

/** Checks whether the given affine expression involves AffineDimExpr
 * 'position'. */
/// Checks whether the given affine expression involves AffineDimExpr
/// 'position'.
MLIR_CAPI_EXPORTED bool mlirAffineExprIsFunctionOfDim(MlirAffineExpr affineExpr,
                                                      intptr_t position);

@@ -194,13 +193,13 @@ MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineCeilDivExprGet(MlirAffineExpr lhs,
/// Checks whether the given affine expression is binary.
MLIR_CAPI_EXPORTED bool mlirAffineExprIsABinary(MlirAffineExpr affineExpr);

/** Returns the left hand side affine expression of the given affine binary
 * operation expression. */
/// Returns the left hand side affine expression of the given affine binary
/// operation expression.
MLIR_CAPI_EXPORTED MlirAffineExpr
mlirAffineBinaryOpExprGetLHS(MlirAffineExpr affineExpr);

/** Returns the right hand side affine expression of the given affine binary
 * operation expression. */
/// Returns the right hand side affine expression of the given affine binary
/// operation expression.
MLIR_CAPI_EXPORTED MlirAffineExpr
mlirAffineBinaryOpExprGetRHS(MlirAffineExpr affineExpr);

+54 −55
Original line number Diff line number Diff line
@@ -18,17 +18,16 @@ extern "C" {
#endif

//===----------------------------------------------------------------------===//
/** Opaque type declarations.
 *
 * Types are exposed to C bindings as structs containing opaque pointers. They
 * are not supposed to be inspected from C. This allows the underlying
 * representation to change without affecting the API users. The use of structs
 * instead of typedefs enables some type safety as structs are not implicitly
 * convertible to each other.
 *
 * Instances of these types may or may not own the underlying object. The
 * ownership semantics is defined by how an instance of the type was obtained.
 */
// Opaque type declarations.
//
// Types are exposed to C bindings as structs containing opaque pointers. They
// are not supposed to be inspected from C. This allows the underlying
// representation to change without affecting the API users. The use of structs
// instead of typedefs enables some type safety as structs are not implicitly
// convertible to each other.
//
// Instances of these types may or may not own the underlying object. The
// ownership semantics is defined by how an instance of the type was obtained.
//===----------------------------------------------------------------------===//

#define DEFINE_C_API_STRUCT(name, storage)                                     \
@@ -52,9 +51,9 @@ static inline bool mlirAffineMapIsNull(MlirAffineMap affineMap) {
/// Checks if two affine maps are equal.
MLIR_CAPI_EXPORTED bool mlirAffineMapEqual(MlirAffineMap a1, MlirAffineMap a2);

/** Prints an affine map by sending chunks of the string representation and
 * forwarding `userData to `callback`. Note that the callback may be called
 * several times with consecutive chunks of the string. */
/// Prints an affine map by sending chunks of the string representation and
/// forwarding `userData to `callback`. Note that the callback may be called
/// several times with consecutive chunks of the string.
MLIR_CAPI_EXPORTED void mlirAffineMapPrint(MlirAffineMap affineMap,
                                           MlirStringCallback callback,
                                           void *userData);
@@ -62,52 +61,52 @@ MLIR_CAPI_EXPORTED void mlirAffineMapPrint(MlirAffineMap affineMap,
/// Prints the affine map to the standard error stream.
MLIR_CAPI_EXPORTED void mlirAffineMapDump(MlirAffineMap affineMap);

/** Creates a zero result affine map with no dimensions or symbols in the
 * context. The affine map is owned by the context. */
/// Creates a zero result affine map with no dimensions or symbols in the
/// context. The affine map is owned by the context.
MLIR_CAPI_EXPORTED MlirAffineMap mlirAffineMapEmptyGet(MlirContext ctx);

/** Creates a zero result affine map of the given dimensions and symbols in the
 * context. The affine map is owned by the context. */
/// Creates a zero result affine map of the given dimensions and symbols in the
/// context. The affine map is owned by the context.
MLIR_CAPI_EXPORTED MlirAffineMap mlirAffineMapZeroResultGet(
    MlirContext ctx, intptr_t dimCount, intptr_t symbolCount);

/** Creates an affine map with results defined by the given list of affine
 * expressions. The map resulting map also has the requested number of input
 * dimensions and symbols, regardless of them being used in the results.
 */
/// Creates an affine map with results defined by the given list of affine
/// expressions. The map resulting map also has the requested number of input
/// dimensions and symbols, regardless of them being used in the results.

MLIR_CAPI_EXPORTED MlirAffineMap mlirAffineMapGet(MlirContext ctx,
                                                  intptr_t dimCount,
                                                  intptr_t symbolCount,
                                                  intptr_t nAffineExprs,
                                                  MlirAffineExpr *affineExprs);

/** Creates a single constant result affine map in the context. The affine map
 * is owned by the context. */
/// Creates a single constant result affine map in the context. The affine map
/// is owned by the context.
MLIR_CAPI_EXPORTED MlirAffineMap mlirAffineMapConstantGet(MlirContext ctx,
                                                          int64_t val);

/** Creates an affine map with 'numDims' identity in the context. The affine map
 * is owned by the context. */
/// Creates an affine map with 'numDims' identity in the context. The affine map
/// is owned by the context.
MLIR_CAPI_EXPORTED MlirAffineMap
mlirAffineMapMultiDimIdentityGet(MlirContext ctx, intptr_t numDims);

/** Creates an identity affine map on the most minor dimensions in the context.
 * The affine map is owned by the context. The function asserts that the number
 * of dimensions is greater or equal to the number of results. */
/// Creates an identity affine map on the most minor dimensions in the context.
/// The affine map is owned by the context. The function asserts that the number
/// of dimensions is greater or equal to the number of results.
MLIR_CAPI_EXPORTED MlirAffineMap
mlirAffineMapMinorIdentityGet(MlirContext ctx, intptr_t dims, intptr_t results);

/** Creates an affine map with a permutation expression and its size in the
 * context. The permutation expression is a non-empty vector of integers.
 * The elements of the permutation vector must be continuous from 0 and cannot
 * be repeated (i.e. `[1,2,0]` is a valid permutation. `[2,0]` or `[1,1,2]` is
 * an invalid invalid permutation.) The affine map is owned by the context. */
/// Creates an affine map with a permutation expression and its size in the
/// context. The permutation expression is a non-empty vector of integers.
/// The elements of the permutation vector must be continuous from 0 and cannot
/// be repeated (i.e. `[1,2,0]` is a valid permutation. `[2,0]` or `[1,1,2]` is
/// an invalid invalid permutation.) The affine map is owned by the context.
MLIR_CAPI_EXPORTED MlirAffineMap mlirAffineMapPermutationGet(
    MlirContext ctx, intptr_t size, unsigned *permutation);

/** Checks whether the given affine map is an identity affine map. The function
 * asserts that the number of dimensions is greater or equal to the number of
 * results. */
/// Checks whether the given affine map is an identity affine map. The function
/// asserts that the number of dimensions is greater or equal to the number of
/// results.
MLIR_CAPI_EXPORTED bool mlirAffineMapIsIdentity(MlirAffineMap affineMap);

/// Checks whether the given affine map is a minor identity affine map.
@@ -116,12 +115,12 @@ MLIR_CAPI_EXPORTED bool mlirAffineMapIsMinorIdentity(MlirAffineMap affineMap);
/// Checks whether the given affine map is an empty affine map.
MLIR_CAPI_EXPORTED bool mlirAffineMapIsEmpty(MlirAffineMap affineMap);

/** Checks whether the given affine map is a single result constant affine
 * map. */
/// Checks whether the given affine map is a single result constant affine
/// map.
MLIR_CAPI_EXPORTED bool mlirAffineMapIsSingleConstant(MlirAffineMap affineMap);

/** Returns the constant result of the given affine map. The function asserts
 * that the map has a single constant result. */
/// Returns the constant result of the given affine map. The function asserts
/// that the map has a single constant result.
MLIR_CAPI_EXPORTED int64_t
mlirAffineMapGetSingleConstantResult(MlirAffineMap affineMap);

@@ -138,17 +137,17 @@ MLIR_CAPI_EXPORTED intptr_t mlirAffineMapGetNumResults(MlirAffineMap affineMap);
MLIR_CAPI_EXPORTED MlirAffineExpr
mlirAffineMapGetResult(MlirAffineMap affineMap, intptr_t pos);

/** Returns the number of inputs (dimensions + symbols) of the given affine
 * map. */
/// Returns the number of inputs (dimensions + symbols) of the given affine
/// map.
MLIR_CAPI_EXPORTED intptr_t mlirAffineMapGetNumInputs(MlirAffineMap affineMap);

/** Checks whether the given affine map represents a subset of a symbol-less
 * permutation map. */
/// Checks whether the given affine map represents a subset of a symbol-less
/// permutation map.
MLIR_CAPI_EXPORTED bool
mlirAffineMapIsProjectedPermutation(MlirAffineMap affineMap);

/** Checks whether the given affine map represents a symbol-less permutation
 * map. */
/// Checks whether the given affine map represents a symbol-less permutation
/// map.
MLIR_CAPI_EXPORTED bool mlirAffineMapIsPermutation(MlirAffineMap affineMap);

/// Returns the affine map consisting of the `resultPos` subset.
@@ -156,17 +155,17 @@ MLIR_CAPI_EXPORTED MlirAffineMap mlirAffineMapGetSubMap(MlirAffineMap affineMap,
                                                        intptr_t size,
                                                        intptr_t *resultPos);

/** Returns the affine map consisting of the most major `numResults` results.
 * Returns the null AffineMap if the `numResults` is equal to zero.
 * Returns the `affineMap` if `numResults` is greater or equals to number of
 * results of the given affine map. */
/// Returns the affine map consisting of the most major `numResults` results.
/// Returns the null AffineMap if the `numResults` is equal to zero.
/// Returns the `affineMap` if `numResults` is greater or equals to number of
/// results of the given affine map.
MLIR_CAPI_EXPORTED MlirAffineMap
mlirAffineMapGetMajorSubMap(MlirAffineMap affineMap, intptr_t numResults);

/** Returns the affine map consisting of the most minor `numResults` results.
 * Returns the null AffineMap if the `numResults` is equal to zero.
 * Returns the `affineMap` if `numResults` is greater or equals to number of
 * results of the given affine map. */
/// Returns the affine map consisting of the most minor `numResults` results.
/// Returns the null AffineMap if the `numResults` is equal to zero.
/// Returns the `affineMap` if `numResults` is greater or equals to number of
/// results of the given affine map.
MLIR_CAPI_EXPORTED MlirAffineMap
mlirAffineMapGetMinorSubMap(MlirAffineMap affineMap, intptr_t numResults);

+85 −85

File changed.

Preview size limit exceeded, changes collapsed.

+54 −54
Original line number Diff line number Diff line
@@ -25,18 +25,18 @@ extern "C" {
/// Checks whether the given type is an integer type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAInteger(MlirType type);

/** Creates a signless integer type of the given bitwidth in the context. The
 * type is owned by the context. */
/// Creates a signless integer type of the given bitwidth in the context. The
/// type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeGet(MlirContext ctx,
                                               unsigned bitwidth);

/** Creates a signed integer type of the given bitwidth in the context. The type
 * is owned by the context. */
/// Creates a signed integer type of the given bitwidth in the context. The type
/// is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeSignedGet(MlirContext ctx,
                                                     unsigned bitwidth);

/** Creates an unsigned integer type of the given bitwidth in the context. The
 * type is owned by the context. */
/// Creates an unsigned integer type of the given bitwidth in the context. The
/// type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeUnsignedGet(MlirContext ctx,
                                                       unsigned bitwidth);

@@ -59,8 +59,8 @@ MLIR_CAPI_EXPORTED bool mlirIntegerTypeIsUnsigned(MlirType type);
/// Checks whether the given type is an index type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAIndex(MlirType type);

/** Creates an index type in the given context. The type is owned by the
 * context. */
/// Creates an index type in the given context. The type is owned by the
/// context.
MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet(MlirContext ctx);

//===----------------------------------------------------------------------===//
@@ -70,29 +70,29 @@ MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet(MlirContext ctx);
/// Checks whether the given type is a bf16 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type);

/** Creates a bf16 type in the given context. The type is owned by the
 * context. */
/// Creates a bf16 type in the given context. The type is owned by the
/// context.
MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet(MlirContext ctx);

/// Checks whether the given type is an f16 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type);

/** Creates an f16 type in the given context. The type is owned by the
 * context. */
/// Creates an f16 type in the given context. The type is owned by the
/// context.
MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet(MlirContext ctx);

/// Checks whether the given type is an f32 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type);

/** Creates an f32 type in the given context. The type is owned by the
 * context. */
/// Creates an f32 type in the given context. The type is owned by the
/// context.
MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet(MlirContext ctx);

/// Checks whether the given type is an f64 type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type);

/** Creates a f64 type in the given context. The type is owned by the
 * context. */
/// Creates a f64 type in the given context. The type is owned by the
/// context.
MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx);

//===----------------------------------------------------------------------===//
@@ -102,8 +102,8 @@ MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx);
/// Checks whether the given type is a None type.
MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type);

/** Creates a None type in the given context. The type is owned by the
 * context. */
/// Creates a None type in the given context. The type is owned by the
/// context.
MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx);

//===----------------------------------------------------------------------===//
@@ -113,8 +113,8 @@ MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx);
/// Checks whether the given type is a Complex type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type);

/** Creates a complex type with the given element type in the same context as
 * the element type. The type is owned by the context. */
/// Creates a complex type with the given element type in the same context as
/// the element type. The type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet(MlirType elementType);

/// Returns the element type of the given complex type.
@@ -146,12 +146,12 @@ MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicDim(MlirType type, intptr_t dim);
MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDimSize(MlirType type,
                                                    intptr_t dim);

/** Checks whether the given value is used as a placeholder for dynamic sizes
 * in shaped types. */
/// Checks whether the given value is used as a placeholder for dynamic sizes
/// in shaped types.
MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicSize(int64_t size);

/** Checks whether the given value is used as a placeholder for dynamic strides
 * and offsets in shaped types. */
/// Checks whether the given value is used as a placeholder for dynamic strides
/// and offsets in shaped types.
MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicStrideOrOffset(int64_t val);

//===----------------------------------------------------------------------===//
@@ -161,15 +161,15 @@ MLIR_CAPI_EXPORTED bool mlirShapedTypeIsDynamicStrideOrOffset(int64_t val);
/// Checks whether the given type is a Vector type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAVector(MlirType type);

/** Creates a vector type of the shape identified by its rank and dimensions,
 * with the given element type in the same context as the element type. The type
 * is owned by the context. */
/// Creates a vector type of the shape identified by its rank and dimensions,
/// with the given element type in the same context as the element type. The
/// type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGet(intptr_t rank,
                                              const int64_t *shape,
                                              MlirType elementType);

/** Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
 * illegal arguments, emitting appropriate diagnostics. */
/// Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
/// illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked(intptr_t rank,
                                                     const int64_t *shape,
                                                     MlirType elementType,
@@ -188,25 +188,25 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsARankedTensor(MlirType type);
/// Checks whether the given type is an unranked tensor type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAUnrankedTensor(MlirType type);

/** Creates a tensor type of a fixed rank with the given shape and element type
 * in the same context as the element type. The type is owned by the context. */
/// Creates a tensor type of a fixed rank with the given shape and element type
/// in the same context as the element type. The type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGet(intptr_t rank,
                                                    const int64_t *shape,
                                                    MlirType elementType);

/** Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
 * illegal arguments, emitting appropriate diagnostics. */
/// Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
/// illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGetChecked(intptr_t rank,
                                                           const int64_t *shape,
                                                           MlirType elementType,
                                                           MlirLocation loc);

/** Creates an unranked tensor type with the given element type in the same
 * context as the element type. The type is owned by the context. */
/// Creates an unranked tensor type with the given element type in the same
/// context as the element type. The type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet(MlirType elementType);

/** Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
 * on illegal arguments, emitting appropriate diagnostics. */
/// Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
/// on illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType
mlirUnrankedTensorTypeGetChecked(MlirType elementType, MlirLocation loc);

@@ -220,41 +220,41 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAMemRef(MlirType type);
/// Checks whether the given type is an UnrankedMemRef type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAUnrankedMemRef(MlirType type);

/** Creates a MemRef type with the given rank and shape, a potentially empty
 * list of affine layout maps, the given memory space and element type, in the
 * same context as element type. The type is owned by the context. */
/// Creates a MemRef type with the given rank and shape, a potentially empty
/// list of affine layout maps, the given memory space and element type, in the
/// same context as element type. The type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(
    MlirType elementType, intptr_t rank, const int64_t *shape, intptr_t numMaps,
    MlirAffineMap const *affineMaps, unsigned memorySpace);

/** Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
 * illegal arguments, emitting appropriate diagnostics. */
/// Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
/// illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGetChecked(
    MlirType elementType, intptr_t rank, const int64_t *shape, intptr_t numMaps,
    MlirAffineMap const *affineMaps, unsigned memorySpace, MlirLocation loc);

/** Creates a MemRef type with the given rank, shape, memory space and element
 * type in the same context as the element type. The type has no affine maps,
 * i.e. represents a default row-major contiguous memref. The type is owned by
 * the context. */
/// Creates a MemRef type with the given rank, shape, memory space and element
/// type in the same context as the element type. The type has no affine maps,
/// i.e. represents a default row-major contiguous memref. The type is owned by
/// the context.
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeContiguousGet(MlirType elementType,
                                                        intptr_t rank,
                                                        const int64_t *shape,
                                                        unsigned memorySpace);

/** Same as "mlirMemRefTypeContiguousGet" but returns a nullptr wrapping
 * MlirType on illegal arguments, emitting appropriate diagnostics. */
/// Same as "mlirMemRefTypeContiguousGet" but returns a nullptr wrapping
/// MlirType on illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeContiguousGetChecked(
    MlirType elementType, intptr_t rank, const int64_t *shape,
    unsigned memorySpace, MlirLocation loc);

/** Creates an Unranked MemRef type with the given element type and in the given
 * memory space. The type is owned by the context of element type. */
/// Creates an Unranked MemRef type with the given element type and in the given
/// memory space. The type is owned by the context of element type.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedMemRefTypeGet(MlirType elementType,
                                                      unsigned memorySpace);

/** Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
 * MlirType on illegal arguments, emitting appropriate diagnostics. */
/// Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
/// MlirType on illegal arguments, emitting appropriate diagnostics.
MLIR_CAPI_EXPORTED MlirType mlirUnrankedMemRefTypeGetChecked(
    MlirType elementType, unsigned memorySpace, MlirLocation loc);

@@ -278,8 +278,8 @@ MLIR_CAPI_EXPORTED unsigned mlirUnrankedMemrefGetMemorySpace(MlirType type);
/// Checks whether the given type is a tuple type.
MLIR_CAPI_EXPORTED bool mlirTypeIsATuple(MlirType type);

/** Creates a tuple type that consists of the given list of elemental types. The
 * type is owned by the context. */
/// Creates a tuple type that consists of the given list of elemental types. The
/// type is owned by the context.
MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx,
                                             intptr_t numElements,
                                             MlirType const *elements);
+22 −22

File changed.

Preview size limit exceeded, changes collapsed.

Loading