From e7df8538eb8f0ed06f0838d946bec8e9e0fe0985 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 1 Dec 2022 18:55:43 -0800 Subject: Allow `no_diff` on `this` parameter. (#2543) --- source/slang/diff.meta.slang | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/slang/diff.meta.slang') diff --git a/source/slang/diff.meta.slang b/source/slang/diff.meta.slang index 69ced9156..033c173ab 100644 --- a/source/slang/diff.meta.slang +++ b/source/slang/diff.meta.slang @@ -11,13 +11,16 @@ attribute_syntax [ForwardDerivative(function)] : ForwardDerivativeAttribute; __attributeTarget(FunctionDeclBase) attribute_syntax [BackwardDifferentiable] : BackwardDifferentiableAttribute; - __attributeTarget(FunctionDeclBase) attribute_syntax [ForwardDerivativeOf(function)] : ForwardDerivativeOfAttribute; __attributeTarget(DeclBase) attribute_syntax [DerivativeMember(memberName)] : DerivativeMemberAttribute; +// Exclude "this" parameter from differentiation. +__attributeTarget(FunctionDeclBase) +attribute_syntax [NoDiffThis] : NoDiffThisAttribute; + /// Pair type that serves to wrap the primal and /// differential types of an arbitrary type T. -- cgit v1.2.3