diff options
| author | Yong He <yonghe@outlook.com> | 2023-10-10 22:07:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-11 13:07:56 +0800 |
| commit | 61132c7e198fe372fc739ba0a1edbc8efef386d2 (patch) | |
| tree | cde10a2e6fc04369dbf29e594670b4a91d6653f4 /source/slang/slang-emit.cpp | |
| parent | cd9a8b2d3fe0e319488ed10ff7147296338685b6 (diff) | |
Report spirv-opt time. (#3271)
* Report spirv-opt time.
* Removing timing logic in `loadModule`.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 57ca736e3..6f78c5d66 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -1308,11 +1308,14 @@ SlangResult emitSPIRVForEntryPointsDirectly( case OptimizationLevel::Maximal: downstreamOptions.optimizationLevel = DownstreamCompileOptions::OptimizationLevel::Maximal; break; default: SLANG_ASSERT(!"Unhandled optimization level"); break; } - + auto downstreamStartTime = std::chrono::high_resolution_clock::now(); if (SLANG_SUCCEEDED(compiler->compile(downstreamOptions, optimizedArtifact.writeRef()))) { artifact = _Move(optimizedArtifact); } + auto downstreamElapsedTime = + (std::chrono::high_resolution_clock::now() - downstreamStartTime).count() * 0.000000001; + codeGenContext->getSession()->addDownstreamCompileTime(downstreamElapsedTime); SLANG_RETURN_ON_FAIL(passthroughDownstreamDiagnostics(codeGenContext->getSink(), compiler, artifact)); } |
