llvm/mlir/lib/CAPI/Dialect/SparseTensor.cpp

//===- Tensor.cpp - C API for SparseTensor dialect ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "mlir-c/Dialect/SparseTensor.h"
#include "mlir-c/IR.h"
#include "mlir/CAPI/AffineMap.h"
#include "mlir/CAPI/Registration.h"
#include "mlir/Dialect/SparseTensor/IR/SparseTensor.h"
#include "mlir/Support/LLVM.h"

usingnamespacellvm;
usingnamespacemlir::sparse_tensor;

MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(SparseTensor, sparse_tensor,
                                      mlir::sparse_tensor::SparseTensorDialect)

// Ensure the C-API enums are int-castable to C++ equivalents.
static_assert;

static_assert;

bool mlirAttributeIsASparseTensorEncodingAttr(MlirAttribute attr) {}

MlirAttribute mlirSparseTensorEncodingAttrGet(
    MlirContext ctx, intptr_t lvlRank,
    MlirSparseTensorLevelType const *lvlTypes, MlirAffineMap dimToLvl,
    MlirAffineMap lvlToDim, int posWidth, int crdWidth,
    MlirAttribute explicitVal, MlirAttribute implicitVal) {}

MlirAffineMap mlirSparseTensorEncodingAttrGetDimToLvl(MlirAttribute attr) {}

MlirAffineMap mlirSparseTensorEncodingAttrGetLvlToDim(MlirAttribute attr) {}

intptr_t mlirSparseTensorEncodingGetLvlRank(MlirAttribute attr) {}

MlirSparseTensorLevelType
mlirSparseTensorEncodingAttrGetLvlType(MlirAttribute attr, intptr_t lvl) {}

enum MlirSparseTensorLevelFormat
mlirSparseTensorEncodingAttrGetLvlFmt(MlirAttribute attr, intptr_t lvl) {}

int mlirSparseTensorEncodingAttrGetPosWidth(MlirAttribute attr) {}

int mlirSparseTensorEncodingAttrGetCrdWidth(MlirAttribute attr) {}

MlirAttribute mlirSparseTensorEncodingAttrGetExplicitVal(MlirAttribute attr) {}

MlirAttribute mlirSparseTensorEncodingAttrGetImplicitVal(MlirAttribute attr) {}

MlirSparseTensorLevelType mlirSparseTensorEncodingAttrBuildLvlType(
    enum MlirSparseTensorLevelFormat lvlFmt,
    const enum MlirSparseTensorLevelPropertyNondefault *properties,
    unsigned size, unsigned n, unsigned m) {}

unsigned
mlirSparseTensorEncodingAttrGetStructuredN(MlirSparseTensorLevelType lvlType) {}

unsigned
mlirSparseTensorEncodingAttrGetStructuredM(MlirSparseTensorLevelType lvlType) {}