diff options
| author | venkataram-nv <vedavamadath@nvidia.com> | 2024-08-13 11:44:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-13 11:44:19 -0700 |
| commit | f4ff4236e1eb80a8274b219d6e4c3813c15be9cd (patch) | |
| tree | 90a5f3db2e0630cda2f5e95d14c0db9cee516233 /source/slang/slang.cpp | |
| parent | ee052a9e9bd7c0d233816556ebe8f0078bd9ec4d (diff) | |
GitHub action benchmark (#4804)
Adds a new Github CI action for benchmarking the slangc compiler on the MDL shaders. For now, the results are only dumped to the output of the CI, which can be later viewed through raw logs. The next step is to use github-action-benchmark to push these results into a page which will show the benchmark results over time as commits are pushed.
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 9ba02ee50..81171fdcc 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -2742,6 +2742,7 @@ static void _outputIncludes(const List<SourceFile*>& sourceFiles, SourceManager* void FrontEndCompileRequest::parseTranslationUnit( TranslationUnitRequest* translationUnit) { + SLANG_PROFILE; if (translationUnit->isChecked) return; @@ -2924,6 +2925,7 @@ void FrontEndCompileRequest::checkAllTranslationUnits() void FrontEndCompileRequest::generateIR() { + SLANG_PROFILE; SLANG_AST_BUILDER_RAII(getLinkage()->getASTBuilder()); // Our task in this function is to generate IR code @@ -3021,6 +3023,7 @@ static SourceLanguage inferSourceLanguage(FrontEndCompileRequest* request) SlangResult FrontEndCompileRequest::executeActionsInner() { + SLANG_PROFILE_SECTION(frontEndExecute); SLANG_AST_BUILDER_RAII(getLinkage()->getASTBuilder()); for (TranslationUnitRequest* translationUnit : translationUnits) @@ -3046,7 +3049,11 @@ SlangResult FrontEndCompileRequest::executeActionsInner() return SLANG_FAIL; // Perform semantic checking on the whole collection - checkAllTranslationUnits(); + { + SLANG_PROFILE_SECTION(SemanticChecking); + checkAllTranslationUnits(); + } + if (getSink()->getErrorCount() != 0) return SLANG_FAIL; @@ -3172,6 +3179,7 @@ void EndToEndCompileRequest::init() SlangResult EndToEndCompileRequest::executeActionsInner() { + SLANG_PROFILE_SECTION(endToEndActions); // If no code-generation target was specified, then try to infer one from the source language, // just to make sure we can do something reasonable when invoked from the command line. // @@ -6303,6 +6311,7 @@ SlangResult EndToEndCompileRequest::compile() if (getOptionSet().getBoolOption(CompilerOptionName::ReportDownstreamTime)) { getSession()->getCompilerElapsedTime(&totalStartTime, &downstreamStartTime); + PerformanceProfiler::getProfiler()->clear(); } #if !defined(SLANG_DEBUG_INTERNAL_ERROR) // By default we'd like to catch as many internal errors as possible, @@ -6317,6 +6326,7 @@ SlangResult EndToEndCompileRequest::compile() try { + SLANG_PROFILE_SECTION(compileInner); res = executeActions(); } catch (const AbortCompilationException& e) |
