diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-12-12 11:39:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-12 11:39:19 -0500 |
| commit | 6e6a876a6b5ad3d2ef402757d2e20641f5a2b49b (patch) | |
| tree | 29eab69c4982537376d7eaf422d9090c849e95f7 /source/slang/slang-options.cpp | |
| parent | 79ec0cfdb5f3461c763e0bf712cf42eb87fccb90 (diff) | |
Slang compiles CUDA source via NVRTC (#1151)
* CPPCompiler -> DownstreamCompiler
* Added DownstreamCompileResult to start abstraction such that we don't need files.
* * Split out slang-blob.cpp
* Made CompileResult hold a DownstreamCompileResult - for access to binary or ISlangSharedLibrary
* Keep temporary files in scope.
* Add a hash to the hex dump stream.
* Move all file tracking into DownstreamCompiler.
* WIP support for nvrtc.
* WIP: Adding support for nvrtc compiler.
Adding enum types, wiring up the nvrtc into slang.
* Fix remaining CPPCompiler references.
* Fix order issue on target string matching.
* Use ISlangSharedLibrary for nvrtc.
* Use DownstreamCompiler for nvrtc.
* WIP first pass at compilation win nvrtc.
* Added testing if file is on file system into CommandLineDownstreamCompiler.
Added sourceContentsPath.
* Make test cuda-compile.cu work by just compiling not comparing output.
* Fix warning on clang.
Diffstat (limited to 'source/slang/slang-options.cpp')
| -rw-r--r-- | source/slang/slang-options.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index c7ede8d93..310042b8b 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -55,7 +55,8 @@ SlangResult tryReadCommandLineArgument(DiagnosticSink* sink, char const* option, x(clang, CLANG) \ x(gcc, GCC) \ x(c, GENERIC_C_CPP) \ - x(cpp, GENERIC_C_CPP) + x(cpp, GENERIC_C_CPP) \ + x(nvrtc, NVRTC) static SlangResult _parsePassThrough(const UnownedStringSlice& name, SlangPassThrough& outPassThrough) { @@ -87,6 +88,10 @@ static SlangSourceLanguage _findSourceLanguage(const UnownedStringSlice& text) { return SLANG_SOURCE_LANGUAGE_HLSL; } + else if (text == "cu" || text == "cuda") + { + return SLANG_SOURCE_LANGUAGE_CUDA; + } return SLANG_SOURCE_LANGUAGE_UNKNOWN; } @@ -334,6 +339,8 @@ struct OptionsParser { ".c", SLANG_SOURCE_LANGUAGE_C, SLANG_STAGE_NONE }, { ".cpp", SLANG_SOURCE_LANGUAGE_CPP, SLANG_STAGE_NONE }, + { ".cu", SLANG_SOURCE_LANGUAGE_CUDA, SLANG_STAGE_NONE } + }; for (int i = 0; i < SLANG_COUNT_OF(entries); ++i) |
