From fbac017938343724407ab036abd736c942b4e187 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 14 Apr 2020 17:00:11 -0400 Subject: CUDA global scope initialization of arrays without function calls. (#1320) * Fix CUDA output of a static const array if values are all literals. * Fix bug in Convert definition. * Output makeArray such that is deconstructed on CUDA to fill in based on what the target type is. Tries to expand such that there are no function calls so that static const global scope definitions work. * Fix unbounded-array-of-array-syntax.slang to work correctly on CUDA. * Remove tabs. * Check works with static const vector/matrix. * Fix typo in type comparison. * Shorten _areEquivalent test. * Rename _emitInitializerList. Some small comment fixes. Co-authored-by: Tim Foley --- source/slang/slang-emit-cpp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 8f59da214..716a8f046 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -999,7 +999,7 @@ void CPPSourceEmitter::_emitConstructConvertDefinition(const UnownedStringSlice& IRType* dstElemType = _getElementType(retType); //IRType* srcElemType = _getElementType(srcType); - TypeDimension dim = _getTypeDimension(srcType, false); + TypeDimension dim = _getTypeDimension(retType, false); UnownedStringSlice rowTypeName; if (dim.rowCount > 1) -- cgit v1.2.3