diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-13 10:57:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-13 10:57:28 -0700 |
| commit | a911ca6e06ce41e403b80fe6054162393491c8ac (patch) | |
| tree | 6c8d56a3060b1887e7fd3126fe54a1241160eddd /source/slang/slang-ir.h | |
| parent | 3fea56ef77a33273bf5af6f432163b30c0a0e1dc (diff) | |
Support high order diff pattern: `bwd_diff(fwd_diff(f))`. (#2695)
* Support high order diff pattern: `bwd_diff(fwd_diff(f))`.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir.h')
| -rw-r--r-- | source/slang/slang-ir.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/slang/slang-ir.h b/source/slang/slang-ir.h index e22ea8a36..14a216fd2 100644 --- a/source/slang/slang-ir.h +++ b/source/slang/slang-ir.h @@ -1448,14 +1448,24 @@ SIMPLE_IR_TYPE(TypeKind, Kind); // SIMPLE_IR_TYPE(GenericKind, Kind) -struct IRDifferentialPairType : IRType +struct IRDifferentialPairTypeBase : IRType { IRType* getValueType() { return (IRType*)getOperand(0); } IRInst* getWitness() { return (IRInst*)getOperand(1); } + IR_PARENT_ISA(DifferentialPairTypeBase) +}; + +struct IRDifferentialPairType : IRDifferentialPairTypeBase +{ IR_LEAF_ISA(DifferentialPairType) }; +struct IRDifferentialPairUserCodeType : IRDifferentialPairTypeBase +{ + IR_LEAF_ISA(DifferentialPairUserCodeType) +}; + struct IRBackwardDiffIntermediateContextType : IRType { IRInst* getFunc() { return getOperand(0); } |
