Skip to content

Commit a582dde

Browse files
authored
[mlir][c-api] expose elideLargeResourceString (#98050)
Expose `elideLargeResourceString` to the c api. This was done in the same way as `elideLargeElementsAttrs` is exposed. The docs were grabbed from the `elideLargeResourceString` method and forwarded here.
1 parent b30d667 commit a582dde

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

mlir/include/mlir-c/IR.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,14 @@ MLIR_CAPI_EXPORTED void
428428
mlirOpPrintingFlagsElideLargeElementsAttrs(MlirOpPrintingFlags flags,
429429
intptr_t largeElementLimit);
430430

431+
/// Enables the elision of large resources strings by omitting them from the
432+
/// `dialect_resources` section. The `largeResourceLimit` is used to configure
433+
/// what is considered to be a "large" resource by providing an upper limit to
434+
/// the string size.
435+
MLIR_CAPI_EXPORTED void
436+
mlirOpPrintingFlagsElideLargeResourceString(MlirOpPrintingFlags flags,
437+
intptr_t largeResourceLimit);
438+
431439
/// Enable or disable printing of debug information (based on `enable`). If
432440
/// 'prettyForm' is set to true, debug information is printed in a more readable
433441
/// 'pretty' form. Note: The IR generated with 'prettyForm' is not parsable.

mlir/lib/CAPI/IR/IR.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ void mlirOpPrintingFlagsElideLargeElementsAttrs(MlirOpPrintingFlags flags,
202202
unwrap(flags)->elideLargeElementsAttrs(largeElementLimit);
203203
}
204204

205+
void mlirOpPrintingFlagsElideLargeResourceString(MlirOpPrintingFlags flags,
206+
intptr_t largeResourceLimit) {
207+
unwrap(flags)->elideLargeResourceString(largeResourceLimit);
208+
}
209+
205210
void mlirOpPrintingFlagsEnableDebugInfo(MlirOpPrintingFlags flags, bool enable,
206211
bool prettyForm) {
207212
unwrap(flags)->enableDebugInfo(enable, /*prettyForm=*/prettyForm);

0 commit comments

Comments
 (0)