images: Remove global variables to allow for parallel execution#2696
Open
rjodinchr wants to merge 2 commits into
Open
images: Remove global variables to allow for parallel execution#2696rjodinchr wants to merge 2 commits into
rjodinchr wants to merge 2 commits into
Conversation
Collaborator
Author
|
Many diffs are needed to comply with |
5af5e97 to
ea162c1
Compare
The primary goal of this commit is to improve CI tracking by introducing a new golden format that can differentiate test results based on command-line arguments. To cleanly extract and pass these arguments into the JSON result outputs, the command-line parsing infrastructure across the CTS required a significant refactoring. Key changes include: * Enhanced CI Tracking: Updates `ci/compare_results.py`, `ci/pocl/golden.json`, and `saveResultsToJson` to include and evaluate an `args` key. The golden JSON now uses a nested format mapping specific argument strings (e.g., `--wimpy -1`) to their expected results, allowing the CI to validate the same binary run under different parameters. * Centralized Parsing Infrastructure: Introduces the `ParseArgsFn` callback and `runTestHarnessWithCheckAndParse`. This offloads custom argument parsing from individual test `main()` functions and safely extracts the arguments used so they can be logged by the test harness. * Help Text Consolidation: Replaces fragmented `printUsage()` functions with unified `help` string references populated directly by the standard parsing callbacks. [run-test: test_computeinfo] [run-test: test_bruteforce -1 -w] [run-test: test_cl_copy_images small_images --num-worker-threads 2 1D] [run-test: test_image_streams 1D --num-worker-threads 2 CL_R CL_FILTER_NEAREST]
Collaborator
Author
|
Depends on #2706 |
d22d2f6 to
159f333
Compare
This patch removes the use of global state across the image conformance tests and replaces it with a passed `context_t` structure. The goal of this change is to be able to run `image_streams` in parallel by removing global variables as they were not thread-safe. This refactoring had to be applied everywhere because `image_streams` needs to update `test_format_set_fn`, which is used by all the image tests. Key changes: * Removed global flags such as `gTestSmallImages`, `gTestMipmaps`, `gDebugTrace`, `gEnablePitch`, etc. * Initialized a `context_t` struct in the `main.cpp` files to store test configuration. * Updated test function signatures across `clCopyImage`, `clFillImage`, `clGetInfo`, and `kernel_read_write` to accept `const context_t &ctx`. [run-test: test_image_streams 1D --num-worker-threads 2 CL_A CL_FILTER_NEAREST] [run-test: test_cl_copy_images small_images --num-worker-threads 2 1D]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch removes the use of global state across the image conformance tests and replaces it with a passed
context_tstructure.The goal of this change is to be able to run
image_streamsin parallel by removing global variables as they were not thread-safe. This refactoring had to be applied everywhere becauseimage_streamsneeds to updatetest_format_set_fn, which is used by all the image tests.Key changes:
gTestSmallImages,gTestMipmaps,gDebugTrace,gEnablePitch, etc.context_tstruct in themain.cppfiles to store test configuration.clCopyImage,clFillImage,clGetInfo, andkernel_read_writeto acceptconst context_t &ctx.