Skip to content

Conversation

AlexeySachkov
Copy link
Contributor

@AlexeySachkov AlexeySachkov commented Sep 15, 2025

Its implementation involve templates, which means slow compile times. [[maybe_unused]] does the job just fine, but it is cheaper.

This patch only changed sycl/ headers, ignoring sycl/ext headers.

We still maintain the fact that our SYCL RT library should be buildable with an old GCC (7.5.0 to be precise) and it doesn't support [[maybe_unused]] C++17 attribute. To avoid the attribute "leaking" into the library code, some of the image accessor code has been split into multiple headers to reduce the surface of what is being included from the library sources.

Its implementation involve templates, which means "extra compilation
time overhead". `[[maybe_unused]]` does the job just fine.

This patch only changed `sycl/` headers, ignoring `sycl/ext` headers.
@AlexeySachkov
Copy link
Contributor Author

This PR prompted by the following failure, observed here in pre-commit for #19936. Whilst I believe the failure to be some kind of merge conflict error, it is a good opportunity to stop using std::ignore anyways.

Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 
FAIL: SYCL :: self-contained-headers/sycl/group_barrier.hpp (641 of 903)
******************** TEST 'SYCL :: self-contained-headers/sycl/group_barrier.hpp' FAILED ********************
Running command: /__w/llvm/llvm/build/bin/clang -fsycl -fsyntax-only -include /__w/llvm/llvm/build/include/sycl/group_barrier.hpp /__w/llvm/llvm/src/sycl/test/self-contained-headers/Inputs/test.cpp
Exit Code: 1

Command Output (stderr):
--
In file included from <built-in>:1:
In file included from /__w/llvm/llvm/build/include/sycl/group_barrier.hpp:12:
/__w/llvm/llvm/build/bin/../include/sycl/detail/spirv.hpp:927:8: error: no member named 'ignore' in namespace 'std'
  927 |   std::ignore = g;
      |        ^~~~~~
/__w/llvm/llvm/build/bin/../include/sycl/detail/spirv.hpp:960:8: error: no member named 'ignore' in namespace 'std'
  960 |   std::ignore = g;
      |        ^~~~~~
2 errors generated.

@AlexeySachkov AlexeySachkov marked this pull request as ready for review September 15, 2025 14:57
@AlexeySachkov AlexeySachkov requested a review from a team as a code owner September 15, 2025 14:57
@AlexeySachkov AlexeySachkov marked this pull request as draft September 15, 2025 15:19
@AlexeySachkov
Copy link
Contributor Author

At this point, it can probably be closed in favor of #20088, even though I personally like the attribute better than the void cast. Tagging @aelovikov-intel for awareness

@aelovikov-intel
Copy link
Contributor

Whilst I believe the failure to be some kind of merge conflict error, it is a good opportunity to stop using std::ignore anyways.

It's probably specific to the default gcc toolchain used in Ubuntu 22.04 (that is the failing task in your pre-commit, which is essentially Nightly workload where the issue had happened too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants