From 86fc50c5092fbccf6072dcf7bbdfafb8915f02c8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 8 Mar 2023 21:52:34 -0800 Subject: Add support for `[PrimalSubstitute]` and `[PrimalSubstituteOf]`. (#2691) * Add support for `[PrimalSubstitute]` and `[PrimalSubstituteOf]`. * Fix * Fix. * Cleanup. --------- Co-authored-by: Yong He --- source/slang/slang-ir-autodiff.cpp | 12 +++++++++--- 1 file changed, 9 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 fcfbf3bee..65e880868 100644 --- a/source/slang/slang-ir-autodiff.cpp +++ b/source/slang/slang-ir-autodiff.cpp @@ -563,12 +563,15 @@ bool isDifferentiableType(DifferentiableTypeConformanceContext& context, IRInst* return false; } -bool canInstBeStored(IRInst* inst) +bool canTypeBeStored(IRInst* type) { - if (as(inst->getDataType())) + if (!type) + return false; + + if (as(type)) return true; - switch (inst->getDataType()->getOp()) + switch (type->getOp()) { case kIROp_StructType: case kIROp_OptionalType: @@ -716,6 +719,9 @@ struct AutoDiffPass : public InstPassBase break; } break; + case kIROp_PrimalSubstitute: + // Explicit primal subst operator is not yet supported. + SLANG_UNIMPLEMENTED_X("explicit primal_subst operator."); default: break; } -- cgit v1.2.3