From 2ddca33686c08e1833c0d82a420fb2b27cde4e37 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 17 Sep 2020 16:46:23 -0700 Subject: Initial attempt to enable CUDA dynamic dispatch codegen (#1549) * Front-load cuda module loading to fill in RTTI pointers. * Enable dynamic dispatch codegen for CUDA. --- source/slang/slang-emit-cuda.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-emit-cuda.cpp') diff --git a/source/slang/slang-emit-cuda.cpp b/source/slang/slang-emit-cuda.cpp index acd913865..ecc3eb68b 100644 --- a/source/slang/slang-emit-cuda.cpp +++ b/source/slang/slang-emit-cuda.cpp @@ -300,7 +300,7 @@ String CUDASourceEmitter::generateEntryPointNameImpl(IREntryPointDecoration* ent // > The input PTX should include one or more NVIDIA OptiX programs. // > The type of program affects how the program can be used during // > the execution of the pipeline. These program types are specified - // by prefixing the program’s name with the following: + // by prefixing the program name with the following: // // > Program type Function name prefix CASE( RayGeneration, __raygen__); @@ -322,6 +322,11 @@ String CUDASourceEmitter::generateEntryPointNameImpl(IREntryPointDecoration* ent return globalSymbolName; } +void CUDASourceEmitter::emitGlobalRTTISymbolPrefix() +{ + m_writer->emit("__device__"); +} + void CUDASourceEmitter::emitCall(const HLSLIntrinsic* specOp, IRInst* inst, const IRUse* operands, int numOperands, const EmitOpInfo& inOuterPrec) { switch (specOp->op) @@ -740,6 +745,9 @@ void CUDASourceEmitter::emitModuleImpl(IRModule* module) // TODO(JS): We may need to generate types (for example for matrices) CLikeSourceEmitter::emitModuleImpl(module); + + // Emit all witness table definitions. + _emitWitnessTableDefinitions(); } -- cgit v1.2.3