From 20262684bcbb707d16669b2670039df870b65ca8 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 10 Jan 2023 17:01:24 -0500 Subject: Small fixes around repro loading/autodiff (#2585) * #include an absolute path didn't work - because paths were taken to always be relative. * Work around for some issue seen with a repro. * Small improvement in doing IDifferentable check. --- source/slang/slang-ir-autodiff.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-ir-autodiff.cpp') diff --git a/source/slang/slang-ir-autodiff.cpp b/source/slang/slang-ir-autodiff.cpp index 53e2ed0be..94417ea00 100644 --- a/source/slang/slang-ir-autodiff.cpp +++ b/source/slang/slang-ir-autodiff.cpp @@ -309,10 +309,15 @@ IRInst* AutoDiffSharedContext::findDifferentiableInterface() // TODO: This seems like a particularly dangerous way to look for an interface. // See if we can lower IDifferentiable to a separate IR inst. // - if (globalInst->getOp() == kIROp_InterfaceType && - as(globalInst)->findDecoration()->getName() == "IDifferentiable") + if (auto intf = as(globalInst)) { - return globalInst; + if (auto decor = intf->findDecoration()) + { + if (decor->getName() == toSlice("IDifferentiable")) + { + return globalInst; + } + } } } } -- cgit v1.2.3