From ade2c39fa3675504ed135ef8abe7b53cfd06ee84 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 22 Jul 2019 17:03:10 -0400 Subject: Use C++ template types in code generation (#1000) * WIP: Adding support for C/C++ compilation to slang API. * Removed BackEndType in test harness -> use SlangPassThrough to identify backends Only require stage for targets that require it. Detection of all different backends. * Windows/Unix create temporary filename. * WIP: Output CPU binaries. * Added a pass-through c/c++ test. * Compile C++/C and store in temporary file. * Read the binary back into memory. * Set debug info and optimization flags for C/C++. Make the CPPCompiler debug/optimization levels match slangs. * Handling of include paths and math precision. * Dumping c++/c source and exe/shared library. * Put hex dump into own util. * End to end pass through c compilation test. * WIP: Simple execute test working on Linux/Unix. * Fix typo on linux. * WIP: To compile slang to cpp shared library. Report backend compiler errors. * Compiles slang -> cpp and loads as shared library. * Fix problem on c-cross-compile test because prelude is now included with <> quotes. * Run slang generated cpp code - using hard coded data. * Added cpp-execute-simple, and test output. * Fix warning that broke win32 build. * Fix compilation problem on osx. * When C++ output use template types. * Require C++14 if using partial specialization for matrix/vector types. * Merge of master + add c-cross-compile.slang.expected * Remove c-cross-compile.slang.expected --- source/core/slang-gcc-compiler-util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/core') diff --git a/source/core/slang-gcc-compiler-util.cpp b/source/core/slang-gcc-compiler-util.cpp index 69d68e608..0a53bcac8 100644 --- a/source/core/slang-gcc-compiler-util.cpp +++ b/source/core/slang-gcc-compiler-util.cpp @@ -369,7 +369,8 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse if (options.sourceType == SourceType::CPP) { - cmdLine.addArg("-std=c++11"); + // Need C++14 for partial specialization + cmdLine.addArg("-std=c++14"); } // Use shared libraries -- cgit v1.2.3