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 ++++++++++++++++++++--- source/slang/slang-emit-cuda.cpp | 10 +++++----- 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'source') 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("}"); + } } } diff --git a/source/slang/slang-emit-cuda.cpp b/source/slang/slang-emit-cuda.cpp index 019bf8b94..c628e5caf 100644 --- a/source/slang/slang-emit-cuda.cpp +++ b/source/slang/slang-emit-cuda.cpp @@ -37,12 +37,12 @@ static bool _isSingleNameBasicType(IROp op) case kIROp_Int8Type: return UnownedStringSlice("char"); case kIROp_Int16Type: return UnownedStringSlice("short"); case kIROp_IntType: return UnownedStringSlice("int"); - case kIROp_Int64Type: return UnownedStringSlice("long long"); + case kIROp_Int64Type: return UnownedStringSlice("longlong"); - case kIROp_UInt8Type: return UnownedStringSlice("unsigned char"); - case kIROp_UInt16Type: return UnownedStringSlice("unsigned short"); - case kIROp_UIntType: return UnownedStringSlice("unsigned int"); - case kIROp_UInt64Type: return UnownedStringSlice("unsigned long long"); + case kIROp_UInt8Type: return UnownedStringSlice("uchar"); + case kIROp_UInt16Type: return UnownedStringSlice("ushort"); + case kIROp_UIntType: return UnownedStringSlice("uint"); + case kIROp_UInt64Type: return UnownedStringSlice("ulonglong"); // Not clear just yet how we should handle half... we want all processing as float probly, but when reading/writing to memory converting case kIROp_HalfType: return UnownedStringSlice("half"); -- cgit v1.2.3