Skip to content

[Python] Develop python bindings for Presburger library #113233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
532 changes: 532 additions & 0 deletions mlir/include/mlir-c/Presburger.h

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,15 @@ class IntegerRelation {
// false.
bool isFullDim();

void *getAsOpaquePointer() const {
return const_cast<IntegerRelation *>(this);
}

static IntegerRelation *getFromOpaquePointer(const void *pointer) {
return const_cast<IntegerRelation *>(
reinterpret_cast<const IntegerRelation *>(pointer));
}

void print(raw_ostream &os) const;
void dump() const;

Expand Down
25 changes: 25 additions & 0 deletions mlir/include/mlir/CAPI/Presburger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//===- Presburger.h - C API Utils for Presburger library --------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file contains declarations of implementation details of the C API for
// Presburger library. This file should not be included from C++ code other than
// C API implementation nor from C code.
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_CAPI_PRESBURGER_H
#define MLIR_CAPI_PRESBURGER_H

#include "mlir-c/Presburger.h"
#include "mlir/Analysis/Presburger/IntegerRelation.h"
#include "mlir/CAPI/Wrap.h"

DEFINE_C_API_PTR_METHODS(MlirPresburgerIntegerRelation,
mlir::presburger::IntegerRelation)

#endif /* MLIR_CAPI_PRESBURGER_H */
Loading