diff options
| author | Yong He <yonghe@outlook.com> | 2020-09-17 16:46:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-17 16:46:23 -0700 |
| commit | 2ddca33686c08e1833c0d82a420fb2b27cde4e37 (patch) | |
| tree | eac30dde6995ed16afbf89bf00b1bf76e7ebfb1f /source/slang/slang-emit-cuda.cpp | |
| parent | 017acb3b58df51ec8bf3bb7eb9f66e58b6713145 (diff) | |
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.
Diffstat (limited to 'source/slang/slang-emit-cuda.cpp')
| -rw-r--r-- | source/slang/slang-emit-cuda.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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(); } |
