From 7f11f883d0781952f002b3aa3222a3aa0040f18a Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 17 Mar 2023 15:57:22 -0700 Subject: Add support for emitting cuda kernel and host functions. (#2712) * Add support for emitting cuda kernel and host functions. * Update test. * Fix cuda preamble emit. --------- Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 9f877969a..206d73e3f 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3159,6 +3159,20 @@ namespace Slang return inst; } + IRInst* IRBuilder::emitDispatchKernelInst(IRType* type, IRInst* baseFn, IRInst* threadGroupSize, IRInst* dispatchSize, Int argCount, IRInst* const* inArgs) + { + List args = {baseFn, threadGroupSize, dispatchSize}; + args.addRange(inArgs, (Index)argCount); + auto inst = createInst( + this, + kIROp_DispatchKernel, + type, + (Int)args.getCount(), + args.getBuffer()); + addInst(inst); + return inst; + } + IRInst* IRBuilder::emitBackwardDifferentiatePrimalInst(IRType* type, IRInst* baseFn) { auto inst = createInst( -- cgit v1.2.3