diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 15:15:19 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 15:15:19 -0500 |
| commit | 272ff05ffad58c43e7a26d6c60d2fc2ec0cc4e4c (patch) | |
| tree | 2e25c9e4a7f08b86ff1e42e05b397cd13e357371 /runtime/test | |
| parent | 95e38c4e13c95eda777875ae175fcacc3163f467 (diff) | |
| parent | f674ba82a1c3f84c59b120bfa2fb900b4c620482 (diff) | |
Merge pull request #3163 from Matheus Gomes
Diffstat (limited to 'runtime/test')
| -rw-r--r-- | runtime/test/vk_pipeline_check.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/runtime/test/vk_pipeline_check.cpp b/runtime/test/vk_pipeline_check.cpp index 3cfa3dbea..260fc72f4 100644 --- a/runtime/test/vk_pipeline_check.cpp +++ b/runtime/test/vk_pipeline_check.cpp | |||
| @@ -1149,14 +1149,20 @@ int main(int argc, char** argv) { | |||
| 1149 | const char* phase; // "module" or "pipeline" | 1149 | const char* phase; // "module" or "pipeline" |
| 1150 | }; | 1150 | }; |
| 1151 | std::map<std::thread::id, InFlight> inflight; | 1151 | std::map<std::thread::id, InFlight> inflight; |
| 1152 | // --inflight-file: rewrite the file from `inflight`, one "name<TAB>phase" line per module. Called with mu held, at | 1152 | // Publish a complete snapshot at the moments named in the header. This keeps the last full report if the |
| 1153 | // the moments named in the header. | 1153 | // process dies while staging the next one. Called with mu held. |
| 1154 | auto write_inflight = [&] { | 1154 | auto write_inflight = [&] { |
| 1155 | if (inflight_path.empty()) return; | 1155 | if (inflight_path.empty()) return; |
| 1156 | if (std::FILE* f = std::fopen(inflight_path.c_str(), "w")) { | 1156 | std::string snapshot; |
| 1157 | for (const auto& [tid, job] : inflight) std::fprintf(f, "%s\t%s\n", job.name.c_str(), job.phase); | 1157 | for (const auto& [tid, job] : inflight) { |
| 1158 | std::fclose(f); | 1158 | snapshot += job.name; |
| 1159 | snapshot += '\t'; | ||
| 1160 | snapshot += job.phase; | ||
| 1161 | snapshot += '\n'; | ||
| 1159 | } | 1162 | } |
| 1163 | if (const auto error = write_pipeline_cache_file(inflight_path, snapshot.data(), snapshot.size())) | ||
| 1164 | std::fprintf(stderr, "in-flight snapshot save to %s failed: %s\n", | ||
| 1165 | inflight_path.c_str(), error.message().c_str()); | ||
| 1160 | }; | 1166 | }; |
| 1161 | const auto t_start = std::chrono::steady_clock::now(); | 1167 | const auto t_start = std::chrono::steady_clock::now(); |
| 1162 | auto elapsed = [&] { return std::chrono::duration<double>(std::chrono::steady_clock::now() - t_start).count(); }; | 1168 | auto elapsed = [&] { return std::chrono::duration<double>(std::chrono::steady_clock::now() - t_start).count(); }; |