From 47715e625337d489f3c0131bbc2b849378b48a5a Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 20 Feb 2023 14:42:50 -0800 Subject: 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 --- source/slang/slang-check-stmt.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'source/slang/slang-check-stmt.cpp') 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()) return; - - // For all ordinary differentiable functions, we require either a `[MaxIters]` attribute, - // or a `[ForceUnroll]` attribet on loops. - if (stmt->hasModifier() || stmt->hasModifier() || stmt->hasModifier()) - { - } - else - { - getSink()->diagnose(stmt, Diagnostics::loopInDiffFuncRequireUnrollOrMaxIters); - } } } -- cgit v1.2.3