summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-link.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2022-06-30 19:24:24 -0400
committerGitHub <noreply@github.com>2022-06-30 19:24:24 -0400
commit77af111867eb72f26b460c5925be47aa22c71556 (patch)
treeb516734ccec92f01eaa07a7844b3862b3c5ab628 /source/slang/slang-ir-link.cpp
parent2c09275388d4c88ea26bf709132b8be4a9e342bc (diff)
Added `[__custom_jvp(func)]` attribute, and modified the derivative pass to only process referenced functions. (#2309)
* Added JVPTranscriber to handle differentiation of load, store, var, param and return instructions, as well as conversion of data and function types * Changed class names to be more in line with convention. Added correct type checking for __jvp() and verified that simple calls with only loads and stores are processed correctly * Added logic to differentiate basic arithmetic and literals inside IRConstruct and fixed the way parameters are differentiated * Replaced some SLANG_UNEXPECTED macro uses with diagnostics instead * Added work-list-based on-demand generation of derivative functions * Fixed up a couple of TODOs * Added attribute [__custom_jvp(f)] to assign a custom derivative function to a declaration * Added a test for CustomJVPAttribute on a redeclaration of an imported function * Moving arithmetic test to new folder * Moving arithmetic test to new folder (2) * Added missing test module * Fixed a minor note Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-ir-link.cpp')
-rw-r--r--source/slang/slang-ir-link.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/slang/slang-ir-link.cpp b/source/slang/slang-ir-link.cpp
index 7984c5037..14724046a 100644
--- a/source/slang/slang-ir-link.cpp
+++ b/source/slang/slang-ir-link.cpp
@@ -446,6 +446,7 @@ static void cloneExtraDecorations(
case kIROp_LayoutDecoration:
case kIROp_PublicDecoration:
case kIROp_SequentialIDDecoration:
+ case kIROp_JVPDerivativeReferenceDecoration:
if(!clonedInst->findDecorationImpl(decoration->getOp()))
{
cloneInst(context, builder, decoration);