From 53793612e3a2f1cadc4f7cbf703bcd94b7121414 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 27 Apr 2023 18:32:20 -0700 Subject: Embed stdlib documentation to AST. (#2851) * Embed stdlib documentation to AST. * Extract documentation for attributes. --------- Co-authored-by: Yong He --- source/slang/diff.meta.slang | 6 +++++- 1 file changed, 5 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 f8b36a3ac..f2f1d0cc3 100644 --- a/source/slang/diff.meta.slang +++ b/source/slang/diff.meta.slang @@ -25,6 +25,7 @@ attribute_syntax [DerivativeMember(memberName)] : DerivativeMemberAttribute; __attributeTarget(FunctionDeclBase) attribute_syntax [NoDiffThis] : NoDiffThisAttribute; +/// Represents a GPU view of a tensor. __generic __magic_type(TensorViewType) __intrinsic_type($(kIROp_TensorViewType)) @@ -231,6 +232,7 @@ extension TensorView void InterlockedCompareExchange(vector index, float compare, float val); } +/// Represents the handle of a Torch tensor object. __generic __intrinsic_type($(kIROp_TorchTensorType)) struct TorchTensor @@ -294,10 +296,12 @@ struct TorchTensor __target_intrinsic(cpp, "AT_CUDA_CHECK(cudaStreamSynchronize(at::cuda::getCurrentCUDAStream()))") void syncTorchCudaStream(); +/// Constructs a `DifferentialPair` value from a primal value and a differential value. __generic __intrinsic_op($(kIROp_MakeDifferentialPairUserCode)) DifferentialPair diffPair(T primal, T.Differential diff); +/// Constructs a `DifferentialPair` value from a primal value and a zero differential value. __generic [__unsafeForceInlineEarly] DifferentialPair diffPair(T primal) @@ -812,7 +816,7 @@ void __d_cross(inout DifferentialPair> a, inout DifferentialPair __intrinsic_op($(kIROp_DetachDerivative)) T detach(T x); -- cgit v1.2.3