From ab8eeeafa2eae54dda78b5fa347bb93c808990f5 Mon Sep 17 00:00:00 2001 From: Theresa Foley Date: Thu, 11 Nov 2021 12:07:07 -0800 Subject: Fix a bug in CUDA source emit (#2010) It seems that we were missing a `template<>` prefix when emitting explicit specializations for the `Matrix<...>` type in the CUDA prelude. This might not have caused errors in some versions of the CUDA compiler, but it at least seems to fail on the 11.5 SDK, which I am using to test locally. --- source/slang/slang-emit-cpp.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/slang') diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index 7e70b73e2..cb6c210be 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -262,6 +262,7 @@ void CPPSourceEmitter::emitTypeDefinition(IRType* inType) UnownedStringSlice typeName = _getTypeName(type); UnownedStringSlice rowTypeName = _getTypeName(vecType); + writer->emit("template<>\n"); writer->emit("struct "); writer->emit(typeName); writer->emit("\n{\n"); -- cgit v1.2.3