From a61f089fbc4b944d058e6417d8a0d22d57ca5c92 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 28 Mar 2023 15:19:03 -0700 Subject: Add slangpy doc, fix cuda prelude. (#2748) * Add slangpy doc, fix cuda prelude. * more bug fix. * fix. * fix. * More fix. * fix. * f * fix prelude. * update prelude. * update doc * Update prelude. * add zeros_like * update doc. --------- Co-authored-by: Yong He --- source/slang/slang-ir-pytorch-cpp-binding.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ir-pytorch-cpp-binding.cpp') diff --git a/source/slang/slang-ir-pytorch-cpp-binding.cpp b/source/slang/slang-ir-pytorch-cpp-binding.cpp index eb81bfd8c..971e87a6f 100644 --- a/source/slang/slang-ir-pytorch-cpp-binding.cpp +++ b/source/slang/slang-ir-pytorch-cpp-binding.cpp @@ -245,6 +245,7 @@ static void generateCppBindingForFunc(IRFunc* func, DiagnosticSink* sink) return; } auto newParam = builder.emitParam(newParamType); + param->transferDecorationsTo(newParam); newParams.add(newParam); } @@ -361,14 +362,16 @@ void generatePyTorchCppBinding(IRModule* module, DiagnosticSink* sink) // Remove all [TorchEntryPoint] functions when emitting CUDA source. void removeTorchKernels(IRModule* module) { + List toRemove; for (auto globalInst : module->getGlobalInsts()) { if (!as(globalInst)) continue; if (globalInst->findDecoration()) - globalInst->removeAndDeallocate(); + toRemove.add(globalInst); } - + for (auto inst : toRemove) + inst->removeAndDeallocate(); } } -- cgit v1.2.3