summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index ea8bec2bb..2613e6430 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -3324,6 +3324,7 @@ namespace Slang
{
VarDecl* indexVar = nullptr;
auto forStmt = synth.emitFor(synth.emitIntConst(0), synth.emitGetArrayLengthExpr(leftValue), indexVar);
+ addModifier(forStmt, synth.getBuilder()->create<ForceUnrollAttribute>());
auto innerLeft = synth.emitIndexExpr(leftValue, synth.emitVarExpr(indexVar));
for (auto& arg : args)
{
@@ -3358,6 +3359,7 @@ namespace Slang
// We synthesize a memberwise dispatch to compute each field of `TResult`,
// resulting an implementation of the form:
// ```
+ // [BackwardDifferentiable]
// static TResult requiredMethod(TParam1 p0, TParam2 p1, ...)
// {
// TResult result;
@@ -3389,6 +3391,9 @@ namespace Slang
ThisExpr* synThis = nullptr;
auto synFunc = synthesizeMethodSignatureForRequirementWitness(
context, requirementDeclRef.as<FuncDecl>(), synArgs, synThis);
+
+ addModifier(synFunc, m_astBuilder->create<BackwardDifferentiableAttribute>());
+
synFunc->parentDecl = context->parentDecl;
synth.pushContainerScope(synFunc);
auto blockStmt = m_astBuilder->create<BlockStmt>();