Skip to content

Commit

Permalink
add width attribute to Forwarddiffop and use it in HandleAutoDiff
Browse files Browse the repository at this point in the history
  • Loading branch information
jumerckx committed Nov 19, 2024
1 parent 01c6223 commit c9451b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions enzyme/Enzyme/MLIR/Dialect/EnzymeOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ def PlaceholderOp : Enzyme_Op<"placeholder",
def ForwardDiffOp : Enzyme_Op<"fwddiff",
[DeclareOpInterfaceMethods<SymbolUserOpInterface>]> {
let summary = "Perform forward mode AD on a funcop";
let arguments = (ins FlatSymbolRefAttr:$fn, Variadic<AnyType>:$inputs, ActivityArrayAttr:$activity, ActivityArrayAttr:$ret_activity);
let results = (outs Variadic<AnyType>:$outputs);
let arguments = (ins FlatSymbolRefAttr:$fn, Variadic<AnyType>:$inputs, ActivityArrayAttr:$activity, ActivityArrayAttr:$ret_activity, DefaultValuedAttr<I64Attr, "1">:$width); let results = (outs Variadic<AnyType>:$outputs);

let assemblyFormat = [{
$fn `(` $inputs `)` attr-dict `:` functional-type($inputs, results)
Expand Down
2 changes: 1 addition & 1 deletion enzyme/Enzyme/MLIR/Passes/EnzymeMLIRPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ struct DifferentiatePass : public DifferentiatePassBase<DifferentiatePass> {
MTypeAnalysis TA;
auto type_args = TA.getAnalyzedTypeInfo(fn);
bool freeMemory = true;
size_t width = 1;
size_t width = CI.getWidth();

std::vector<bool> volatile_args;
for (auto &a : fn.getFunctionBody().getArguments()) {
Expand Down

0 comments on commit c9451b0

Please sign in to comment.