summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-stmt.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-02-20 14:42:50 -0800
committerGitHub <noreply@github.com>2023-02-20 14:42:50 -0800
commit47715e625337d489f3c0131bbc2b849378b48a5a (patch)
treebc737c8f03ef537b2ac39860bbb922c7600edc43 /source/slang/slang-check-stmt.cpp
parent8b05df4187117d61491f2fdbeb7d744146ad73f7 (diff)
Miscellaneous backward autodiff fixes. (#2665)
* Fix differentiable type registration * Fix use of non-differentiable return value in a differentiable func. * Fix use of primal inst that does not dominate the diff block. * Fix primal inst hoisting, and add missing type legalization logic. * Make `detach` defined on all differentiable T. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
-rw-r--r--source/slang/slang-check-stmt.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index 519ca91ff..bc89dc94e 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -585,6 +585,7 @@ namespace Slang
void SemanticsStmtVisitor::checkLoopInDifferentiableFunc(Stmt* stmt)
{
+ SLANG_UNUSED(stmt);
if (getParentDifferentiableAttribute())
{
if (!getParentFunc())
@@ -601,16 +602,6 @@ namespace Slang
return;
if (getParentFunc()->findModifier<BackwardDerivativeAttribute>())
return;
-
- // For all ordinary differentiable functions, we require either a `[MaxIters]` attribute,
- // or a `[ForceUnroll]` attribet on loops.
- if (stmt->hasModifier<MaxItersAttribute>() || stmt->hasModifier<ForceUnrollAttribute>() || stmt->hasModifier<InferredMaxItersAttribute>())
- {
- }
- else
- {
- getSink()->diagnose(stmt, Diagnostics::loopInDiffFuncRequireUnrollOrMaxIters);
- }
}
}