Skip to content

Commit

Permalink
Update docs based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfmorel committed Aug 8, 2024
1 parent 7448ef1 commit c4e08cd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions mlir/include/mlir/Dialect/DLTI/DLTI.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ class DataLayoutEntryAttrStorage;
} // namespace mlir
namespace mlir {
namespace dlti {
/// Find the first DataLayoutSpec associated to `op`, via either the
/// DataLayoutOpInterface, a method on ModuleOp, or an attribute implementing
/// the interface, on `op` and else on `op`'s ancestors in turn.
DataLayoutSpecInterface getDataLayoutSpec(Operation *op);

/// Find the first TargetSystemSpec associated to `op`, via either the
/// DataLayoutOpInterface, a method on ModuleOp, or an attribute implementing
/// the interface, on `op` and else on `op`'s ancestors in turn.
TargetSystemSpecInterface getTargetSystemSpec(Operation *op);
} // namespace dlti
} // namespace mlir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def QueryOp : Op<Transform_Dialect, "dlti.query", [
This op queries data layout and target information associated to payload
IR by way of the DLTI dialect. A lookup is performed for the given `key`
at the `target` op, with the DLTI dialect determining which interfaces and
attributes are consulted.
attributes are consulted - first checking `target` and then its ancestors.

When only `key` is provided, the lookup occurs with respect to the data
layout specification of DLTI. When `device` is provided, the lookup occurs
Expand All @@ -33,8 +33,8 @@ def QueryOp : Op<Transform_Dialect, "dlti.query", [

#### Return modes

When succesfull, the result, `associated_attr`, associates one attribute
as a param for each op in `target`'s payload.
When succesful, the result, `associated_attr`, associates one attribute as a
param for each op in `target`'s payload.

If the lookup fails - as DLTI specifications or entries with the right
names are missing (i.e. the values of `device` and `key`) - a definite
Expand Down
8 changes: 4 additions & 4 deletions mlir/lib/Dialect/DLTI/DLTI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ TargetSystemSpecAttr::verify(function_ref<InFlightDiagnostic()> emitError,
return success();
}

//===----------------------------------------------------------------------===//
// DLTIDialect
//===----------------------------------------------------------------------===//

DataLayoutSpecInterface dlti::getDataLayoutSpec(Operation *op) {
DataLayoutSpecInterface dlSpec = nullptr;

Expand Down Expand Up @@ -424,10 +428,6 @@ TargetSystemSpecInterface dlti::getTargetSystemSpec(Operation *op) {
return sysSpec;
}

//===----------------------------------------------------------------------===//
// DLTIDialect
//===----------------------------------------------------------------------===//

constexpr const StringLiteral mlir::DLTIDialect::kDataLayoutAttrName;
constexpr const StringLiteral mlir::DLTIDialect::kDataLayoutEndiannessKey;
constexpr const StringLiteral mlir::DLTIDialect::kDataLayoutEndiannessBig;
Expand Down

0 comments on commit c4e08cd

Please sign in to comment.