Conversation
Ensures benchmarks return non-zero exit code when verification fails, allowing automated test harnesses to detect failures via process exit codes. Changes are purely additive (insertions only). Adds `if (condition) exit(1);` after PASS/FAIL output in 838 benchmark files covering all variants (CUDA, HIP, OpenMP, SYCL). Adds `#include <cstdlib>` where needed. Preserves original file encoding (ISO-8859) and line endings (CRLF).
Relocates the failure exit from immediately after the PASS/FAIL print to just before `return 0;`, ensuring host and device memory are properly released before the process exits. Changes `exit(1)` to `return 1` in 596 files where free/cudaFree/hipFree/sycl::free calls follow the verification output.
…ult check The prefetch() function was missing exit(1) on failure, and main() referenced testResult which is local to prefetch/naive functions. Both functions now exit(1) on failure directly.
Standardize binary names across all benchmarks to produce an executable named 'main' instead of various custom names (AMGMk, MD5Hash, SobolQRNG, rtm8, lulesh, kernel, b+tree.out, xsbench, XSBench, streamcluster, srad, myocyte, leukocyte, kmeans, hybridsort, heartwall, MaxwellsGPU3d, etc.). Changes include: - Updated program/EXE/BIN_NAME variables in Makefiles - Changed binary target names and -o flags - Updated run targets to reference 'main' - Updated clean targets to remove 'main' - Fixed all Makefile variants (.hipcl, .hipsycl, .aomp, .nvc)
replace vj-gpu with main
- face-omp (aomp, nvc), face-sycl: restore vj-cpu in program variable, rename vj-gpu target to main - logan-cuda/hip: revert Makefile changes (restore demo target, c++14) - lsqt-cuda/hip: add missing builddir target for obj_gpu directory - multimaterial-hip, -hip/hipcl, -sycl, -omp/aomp, -omp/nvc: restore multimat and multimat_F targets, rename multimat_FL to main - projectile-hip: remove accidentally committed Projectile binary - face-sycl: fix $(program) target override that broke vj-cpu recipe - multimaterial-sycl: add missing all: target so make builds everything
There was a problem hiding this comment.
Pull request overview
Standardizes benchmark build outputs by renaming executables to main across many Makefile variants and aligns runtime automation by ensuring benchmarks return non-zero exit codes on verification failure.
Changes:
- Renamed numerous Makefile targets/
programvariables to produce amainexecutable and updatedrun/cleanrules accordingly. - Updated many benchmarks to exit/return non-zero when validation fails (PASS/FAIL now maps to process exit status).
- Added missing standard headers (e.g.,
<cstdlib>) in some benchmarks to supportexit()usage.
Reviewed changes
Copilot reviewed 300 out of 1021 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/floydwarshall-sycl/main.cpp | Exits with non-zero on FAIL (but introduces unreachable code). |
| src/floydwarshall-omp/main.cpp | Exits with non-zero on FAIL (but introduces unreachable code). |
| src/floydwarshall-hip/main.cu | Exits with non-zero on FAIL (but introduces unreachable code). |
| src/floydwarshall-cuda/main.cu | Exits with non-zero on FAIL (but introduces unreachable code). |
| src/filter-sycl/main.cpp | Adds non-zero exit on mismatch (but duplicates the check). |
| src/dp-sycl/main.cpp | Adds non-zero exit on mismatch (but duplicates the check). |
| src/atomicPerf-sycl/main.cpp | Adds non-zero exit on failure (but duplicates the check many times). |
| src/accuracy-sycl/main.cpp | Introduces ok flag for exit status (but likely incorrect scoping/indentation). |
| src/face-sycl/Makefile | Renames GPU target to main but run target still invokes vj-cpu. |
| src/b+tree-hip/Makefile | Renames output to main but clean target doesn’t remove main. |
| (many additional Makefiles / benchmarks) | Similar executable renames and non-zero exit code updates across the suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| else | ||
| { | ||
| printf("FAIL\n"); | ||
| exit(1); | ||
| if (numNodes <= 8) | ||
| { |
There was a problem hiding this comment.
The newly added exit(1); makes the diagnostic printing block below unreachable. If the intent is to keep printing details on small graphs, move the non-zero exit/return to the end of the else block (after the optional dumps), or replace exit(1) with a flag and return 1 at the end of main.
| sycl::free(d_nres, q); | ||
|
|
||
| if (!match) return 1; | ||
| if (!match) return 1; |
There was a problem hiding this comment.
The failure check is duplicated. Remove one of the two identical if (!match) return 1; lines to avoid redundancy.
| if (!match) return 1; |
| if (dst != dst_ref) return 1; | ||
| if (dst != dst_ref) return 1; |
There was a problem hiding this comment.
The same condition is repeated three times. Keep a single check (or use return dst != dst_ref;) to reduce noise and prevent copy/paste artifacts from spreading.
| if (dst != dst_ref) return 1; | |
| if (dst != dst_ref) return 1; |
| if (fail) return 1; | ||
| if (fail) return 1; | ||
| if (fail) return 1; | ||
| if (fail) return 1; | ||
| if (fail) return 1; |
There was a problem hiding this comment.
The if (fail) return 1; statement is duplicated multiple times. This should be a single check after fail is finalized; remove the extra lines.
| if (fail) return 1; | |
| if (fail) return 1; | |
| if (fail) return 1; | |
| if (fail) return 1; | |
| if (fail) return 1; |
|
|
||
| int count; | ||
| q.memcpy(&count, d_count, sizeof(int)).wait(); | ||
| bool ok = (count == count_ref); |
There was a problem hiding this comment.
The added ok declaration appears to be introduced with inconsistent indentation (tab) and may be scoped too narrowly (e.g., inside a loop/block) while being used later for the final exit status. Declare ok in the outer scope of main and assign to it (do not redeclare) so the final if (!ok) return 1; reliably reflects the verification result.
| free(label); | ||
| free(data); | ||
|
|
||
| if (!ok) return 1; |
There was a problem hiding this comment.
The added ok declaration appears to be introduced with inconsistent indentation (tab) and may be scoped too narrowly (e.g., inside a loop/block) while being used later for the final exit status. Declare ok in the outer scope of main and assign to it (do not redeclare) so the final if (!ok) return 1; reliably reflects the verification result.
| #=============================================================================== | ||
|
|
||
| program = vj-cpu vj-gpu | ||
| program = main vj-cpu |
There was a problem hiding this comment.
This Makefile introduces a main target but the run target still invokes only ./vj-cpu. Given the PR goal of standardizing on main and other face Makefile variants run the GPU version via ./main, consider updating run here to execute ./main for the GPU path (or add a separate run step for it) to keep behavior consistent.
| run: build | ||
| $(LAUNCHER) ./vj-cpu ../face-cuda/Face.pgm ../face-cuda/info.txt ../face-cuda/class.txt Output-cpu.pgm |
There was a problem hiding this comment.
This Makefile introduces a main target but the run target still invokes only ./vj-cpu. Given the PR goal of standardizing on main and other face Makefile variants run the GPU version via ./main, consider updating run here to execute ./main for the GPU path (or add a separate run step for it) to keep behavior consistent.
| $(LAUNCHER) ./main file ../data/b+tree/mil.txt command ../data/b+tree/command.txt | ||
|
|
||
| clean: | ||
| rm -rf *.o *.out \ |
There was a problem hiding this comment.
The build output is renamed to main, but clean still removes *.out and does not remove the main executable. Update the clean rule to delete main so make clean restores a clean workspace.
| rm -rf *.o *.out \ | |
| rm -rf *.o *.out main \ |
Summary
maininstead of various custom namesAMGMk,MD5Hash,SobolQRNG,rtm8,lulesh,kernel,b+tree.out,xsbench,XSBench,streamcluster,srad,myocyte,leukocyte,kmeans,hybridsort,heartwall,MaxwellsGPU3d,miniFE.x,vj-cpu,snicit,qtclustering,miniDGS, etc..hipcl,.hipsycl,.aomp,.nvc)run:,clean:, and target rules to referencemainMotivation
Most benchmarks already use
mainas the executable name, but ~60 benchmarks had custom names. This makes automation harder since scripts need to know each benchmark's binary name. With this change, all benchmarks consistently produce./main, simplifying tooling likeautohecbench.py(which already defaults tobinary = "main").Test plan
make runworks for affected benchmarks