From 199d1f52b6690843fbdc7a383775396469516e56 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 7 Feb 2020 13:10:04 -0500 Subject: HLSL Intrinsic coverage test improvements (#1206) * Fix CPP construct when matrix type. * Test intrinsics on float matrices. * Fix typo in _areNearlyEqual test. Increased default sensitivity. Added matrix-float test. * Matrix double test. Fixed some issues with CUDA. * Added reduced intrinsic version of matrix-double test. * Improve matrix double coverage. Test reflect/length etc on vector float. * * Added literal-float test. * Added vector double test * Improved coverage of vector/matrix tests * Disable Dx11 double-vector test because fails on CI. * Disable literal-float, because on CI fails. --- source/slang/slang-emit-cpp.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-emit-cpp.cpp') diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index 99d1fbf22..f3d16444a 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -1166,8 +1166,18 @@ void CPPSourceEmitter::_emitConstructConvertDefinition(const UnownedStringSlice& { writer->emit(", \n"); } - writer->emit(rowTypeName); - writer->emit("{ "); + + if (m_target == CodeGenTarget::CUDASource) + { + m_writer->emit("make_"); + writer->emit(rowTypeName); + m_writer->emit("("); + } + else + { + writer->emit(rowTypeName); + writer->emit("{ "); + } } for (int j = 0; j < dim.colCount; ++j) @@ -1184,7 +1194,14 @@ void CPPSourceEmitter::_emitConstructConvertDefinition(const UnownedStringSlice& } if (dim.rowCount > 1) { - writer->emit("}"); + if (m_target == CodeGenTarget::CUDASource) + { + writer->emit(")"); + } + else + { + writer->emit("}"); + } } } -- cgit v1.2.3