Skip to content

Commit

Permalink
Update descriptions for the OpInterface.
Browse files Browse the repository at this point in the history
Signed-off-by: Haruki Imai <[email protected]>
  • Loading branch information
imaihal committed Oct 30, 2024
1 parent f0b92f0 commit 5ee9e77
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Interface/KrnlGlobalOpInterface.td
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,30 @@ include "mlir/IR/OpBase.td"

def KrnlGlobalOpInterface : OpInterface<"KrnlGlobalOpInterface"> {
let description = [{
A KrnlGlobalOp-like operation is one that holds global constant value. It has
`name` attribute, `shape` attribute, `offset` attribute, and `alighnment`
attribute. Its content is stored in the `value` attribute, which can be
converted when retrieving.
}];

let methods = [
InterfaceMethod<"Get the buffer for the constant value from value attribute. ",
InterfaceMethod<"Get the buffer for the constant value from value attribute. "
"If conversions are required to get the buffer. It should be "
"done in this method. The constant value is stored in newly "
"allocated buffer. The buffer needs to be freed afte use by "
"using `freeBuffer()`.",
"::mlir::ArrayRef<char>", "getBuffer", (ins )
>,
InterfaceMethod<"Get the size of the buffer for the constant value.",
InterfaceMethod<"Get the size of the buffer. ",
"uint64_t", "getBufferSize", (ins )
>,
InterfaceMethod<"Free the buffer for the constant value retrieved from value "
"attribute.",
"void", "freeBuffer", (ins "::mlir::ArrayRef<char>": $buffer)
>,
InterfaceMethod<"Update the `value` attribute.",
InterfaceMethod<"Update the `value` attribute by converting existing `value` "
"attribute. Assume to use getBuffer(), setValueAttr(), and "
"freeBuffer() in this function.",
"void", "updateValueAttr", (ins )
>,
InterfaceMethod<"Get the value from the attribute.",
Expand Down

0 comments on commit 5ee9e77

Please sign in to comment.