summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-02-07 13:10:04 -0500
committerGitHub <noreply@github.com>2020-02-07 13:10:04 -0500
commit199d1f52b6690843fbdc7a383775396469516e56 (patch)
tree672304471e8cc86131fd317d76ede1f60ea8e7a5 /source
parentaf84d85799758234110fc42f0ba5c771dacb5fe3 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-cpp.cpp23
-rw-r--r--source/slang/slang-emit-cuda.cpp10
2 files changed, 25 insertions, 8 deletions
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");