From df02f3f50f977112ca1fbb148cd48ee41d560f41 Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Thu, 9 Feb 2023 17:40:20 -0500 Subject: Reverse-mode Loop Support (#2635) * Full loop support now working. MaxItersAttr in progress * Lookup table updates? * Fixed the max iters decoration * Minox fixes & remove superfluous code * fixup warnings * Revert "Lookup table updates?" This reverts commit 7d9b0793fb5239f31d1155776e846dcf1892d8d9. * Update 07-autodiff.md * Change maxiters to MaxIters * Added asserts * Update 07-autodiff.md --- source/slang/slang-check-modifier.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/slang/slang-check-modifier.cpp') diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index e73f04301..9f3e79978 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -507,6 +507,17 @@ namespace Slang // as 1 arg if nothing is specified) SLANG_ASSERT(attr->args.getCount() == 1); } + else if (auto maxItersAttrs = as(attr)) + { + if (auto cint = checkConstantIntVal(attr->args[0])) + { + maxItersAttrs->value = (int32_t) cint->value; + } + else + { + getSink()->diagnose(attr, Diagnostics::notEnoughArguments, attr->args.getCount(), 1); + } + } else if (auto userDefAttr = as(attr)) { // check arguments against attribute parameters defined in attribClassDecl -- cgit v1.2.3