Skip to content

[libclc] Fix data races in libclc/libspirv LIT tests #17902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

frasercrmck
Copy link
Contributor

Multiple libclc test targets were running essentially the same test suite in parallel. This could result in data races when one target writes a file another target is reading.

This commit fixes the issue by creating a unique test execution directory per target. We already have a unique libclc target known as an 'arch suffix' in CMake. This suffix is used as the unique builtins file name. We pass this through to LIT via a parameter to create the execution directory. Note this use of LIT (i.e., having one suite called multiple times in different configurations) is unconventional so there aren't many similar examples in LLVM.

Patch proposed by @bader.

Multiple libclc test targets were running essentially the same test
suite in parallel. This could result in data races when one target
writes a file another target is reading.

This commit fixes the issue by creating a unique test execution
directory per target. We already have a unique libclc target known as an
'arch suffix' in CMake. This suffix is used as the unique builtins file
name. We pass this through to LIT via a parameter to create the
execution directory. Note this use of LIT (i.e., having one suite called
multiple times in different configurations) is unconventional so there
aren't many similar examples in LLVM.

Patch proposed by @bader.
@frasercrmck frasercrmck requested review from bader and jsji April 8, 2025 11:34
@frasercrmck frasercrmck requested a review from a team as a code owner April 8, 2025 11:34
@frasercrmck frasercrmck requested a review from Seanst98 April 8, 2025 11:34
@frasercrmck frasercrmck added the libclc libclc project related issues label Apr 8, 2025
@frasercrmck frasercrmck changed the title [libclc] Fix data races on libclc/libspirv LIT tests [libclc] Fix data races in libclc/libspirv LIT tests Apr 8, 2025
Copy link
Contributor

@jsji jsji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@frasercrmck
Copy link
Contributor Author

@intel/llvm-gatekeepers this is ready to merge, thanks.

@kbenzie kbenzie merged commit 84fac44 into intel:sycl Apr 8, 2025
24 checks passed
@frasercrmck frasercrmck deleted the libspirv-lit-test-clashes branch April 8, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libclc libclc project related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants