Skip to content

Conversation

@robertszafa
Copy link
Contributor

The SYCL spec allows the following operators for sycl::vec<std::byte>
Comparison: ==, !=, <, <=, >, >=
Bitwise: &, |, ^, ~, &=, |=, ^=

This sycl::vec spec change was introduced in SYCL-Docs PR #674.

The SYCL spec allows the following operators for sycl::vec<std::byte>:
    Comparison: ==, !=, <, <=, >, >=
    Bitwise: &, |, ^, ~, &=, |=, ^=

This spec revision was introduced in the SYCL-Docs PR intel#674.
@robertszafa robertszafa requested a review from a team as a code owner October 23, 2025 13:33
@aelovikov-intel
Copy link
Contributor

aelovikov-intel commented Oct 23, 2025

I thought I've implemented all the sycl::vec specification changes under -fpreview-breaking-changes. Are you trying to fix things without preview?

The changes to align "preview" sycl::vec spanned several PRs and it was impossible to break everything into atomic independent patches, but I think #17722 was the one related to the std::byte the most.

And we enabled that (and other PRs') new implementation under -fpreview-breaking-changes in #18225.

On top of that, I believe we will be entering ABI breaking window for the next major release in a few weeks, when we'll "un-guard" those breaking changes and make them active by default without extra options.

@robertszafa
Copy link
Contributor Author

Thanks for the pointers to the PRs! I might be missing something, but I don't see how these PRs enable the sycl::vec<std::byte> operators discussed in SYCL-Docs PR #674. The below code from the latest SYCL-CTS fails to compile, with and without -fpreview-breaking-changes when using release v6.2:

auto testVec1 = sycl::vec<std::byte, 1>(static_cast<std::byte>(1));
auto testVec2 = sycl::vec<std::byte, 1>(static_cast<std::byte>(2));
resVec = testVec1 == testVec2;

DPC++ release v6.2 used a version of SYCL-CTS (87f8677c), which did does test these sycl::vec<std::byte> operators. Again, I might be missing something, but I don't see support for these operators added in the commits since the v6.2 tag.

@aelovikov-intel
Copy link
Contributor

aelovikov-intel commented Oct 24, 2025

Using origin/sycl:

$ cat a.cpp                                                          
#include <sycl/sycl.hpp>                                             
                                                                     
int main() {                                                         
  auto testVec1 = sycl::vec<std::byte, 1>(static_cast<std::byte>(1));
  auto testVec2 = sycl::vec<std::byte, 1>(static_cast<std::byte>(2));
  auto resVec = testVec1 == testVec2;                                
}                                                                    
$ clang++ -fsycl a.cpp                                                                                           
a.cpp:6:26: error: use of overloaded operator '==' is ambiguous (with operand types 'sycl::vec<std::byte, 1>' and
      'sycl::vec<std::byte, 1>')                                                                                 
    6 |   auto resVec = testVec1 == testVec2;                                                                    
      |                 ~~~~~~~~ ^  ~~~~~~~~                                                                     
a.cpp:6:26: note: built-in candidate operator==(enum std::byte, enum std::byte)                                  
a.cpp:6:26: note: built-in candidate operator==(int, int)                                                        
...

$ clang++ -fsycl -fpreview-breaking-changes a.cpp
$

I've also checked that 6.2 release reports the same error in both default/preview modes indeed. I think 6.3 will include the fixes necessary though.

@robertszafa
Copy link
Contributor Author

Okay, I haven't tried with commits beyond v6.2. Thanks for checking! Closing.

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