From 17c6c6044965629a3ae7e8ef004cc0b2ca657c55 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 4 Feb 2020 15:19:48 -0500 Subject: CUDA/C++ backend improvements (#1198) * WIP with vector float test. * vector-float test working. * Fixed remaing tests broken with init changes. * Improve 64bit-type-support.md * Disable tests broken on CI system for Dx. * WIP: Make type available for comparison. * Moved type conversion into TypeTextUtil. * Add text/type conversions from DownstreamCompiler to TypeTextUtil. * Allow compaison taking into account type. * Removed quantize in vector-float.slang test. --- source/slang/slang-emit-cuda.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (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 2d49e606c..019bf8b94 100644 --- a/source/slang/slang-emit-cuda.cpp +++ b/source/slang/slang-emit-cuda.cpp @@ -393,9 +393,9 @@ void CUDASourceEmitter::emitCall(const HLSLIntrinsic* specOp, IRInst* inst, cons IRType* retType = specOp->returnType; - switch (retType->op) + if (IRVectorType* vecType = as(retType)) { - case kIROp_VectorType: + if (numOperands == GetIntVal(vecType->getElementCount())) { // Get the type name writer->emit("make_"); @@ -414,8 +414,8 @@ void CUDASourceEmitter::emitCall(const HLSLIntrinsic* specOp, IRInst* inst, cons writer->emitChar(')'); return; } - default: break; } + // Just use the default break; } default: break; @@ -542,10 +542,14 @@ void CUDASourceEmitter::emitPreprocessorDirectivesImpl() } } - // Emit all the intrinsics that were used - for (const auto& keyValue : m_intrinsicNameMap) { - _maybeEmitSpecializedOperationDefinition(keyValue.Key); + List intrinsics; + m_intrinsicSet.getIntrinsics(intrinsics); + // Emit all the intrinsics that were used + for (auto intrinsic : intrinsics) + { + _maybeEmitSpecializedOperationDefinition(intrinsic); + } } } -- cgit v1.2.3