summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-autodiff.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-03-08 21:52:34 -0800
committerGitHub <noreply@github.com>2023-03-08 21:52:34 -0800
commit86fc50c5092fbccf6072dcf7bbdfafb8915f02c8 (patch)
treeb4f9eb6cb1eea88145fde0bd1f670a8803120257 /source/slang/slang-ir-autodiff.cpp
parent257733f328f38a763c8b0c8830ff4c0d34ec9491 (diff)
Add support for `[PrimalSubstitute]` and `[PrimalSubstituteOf]`. (#2691)
* Add support for `[PrimalSubstitute]` and `[PrimalSubstituteOf]`. * Fix * Fix. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-autodiff.cpp')
-rw-r--r--source/slang/slang-ir-autodiff.cpp12
1 files changed, 9 insertions, 3 deletions
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<IRBasicType>(inst->getDataType()))
+ if (!type)
+ return false;
+
+ if (as<IRBasicType>(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;
}