Enzyme
main
Loading...
Searching...
No Matches
MLIR
Interfaces
AutoDiffOpInterface.h
Go to the documentation of this file.
1
//===- AutoDiffOpInterface.h - Op interface for auto diff- -------* C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines the interfaces necessary to implement scalable automatic
10
// differentiation across an unbounded number of MLIR IR constructs.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef ENZYME_MLIR_INTERFACES_AUTODIFFOPINTERFACE_H
15
#define ENZYME_MLIR_INTERFACES_AUTODIFFOPINTERFACE_H
16
17
#include "mlir/IR/OpDefinition.h"
18
#include "mlir/Interfaces/ControlFlowInterfaces.h"
19
20
namespace
mlir
{
21
22
class
OpBuilder;
23
class
Operation;
24
class
IRMapping;
25
class
PatternRewriter;
26
27
namespace
enzyme {
28
29
class
MGradientUtils;
30
class
MGradientUtilsReverse;
31
32
};
// namespace enzyme
33
};
// namespace mlir
34
35
#include "MLIR/Interfaces/AutoDiffOpInterface.h.inc"
36
37
namespace
mlir
{
38
namespace
enzyme {
39
inline
bool
isFunctionReturnLike
(Operation *op) {
40
return
op->hasTrait<OpTrait::ReturnLike>() ||
41
isa<FunctionReturnOpInterface>(op);
42
}
43
}
// namespace enzyme
44
}
// namespace mlir
45
46
#endif
// ENZYME_MLIR_INTERFACES_AUTODIFFOPINTERFACE_H
mlir::enzyme::isFunctionReturnLike
bool isFunctionReturnLike(Operation *op)
Definition
AutoDiffOpInterface.h:39
mlir
Definition
ActivityAnalysis.h:9
Generated on Tue Oct 13 2026 01:33:28 for Enzyme by
1.12.0