Skip to content
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

Ill-formed if constexpr branch in vector_operator CTS test for sycl::vec<bool> #896

Closed
uditagarwal97 opened this issue May 23, 2024 · 2 comments

Comments

@uditagarwal97
Copy link
Contributor

uditagarwal97 commented May 23, 2024

Description

We have the following in the vector_operator test for sycl::vec<bool>, where the discarded branch of if constexpr is ill-formed - it is trying to increment vec<bool> which is not allowed by the SPEC.

if constexpr (!std::is_same_v<bool, bool>) {
      for (int i = 0; i < 1; ++i) {
        resArr[i] = static_cast<bool>(1);
      }
      for (int i = 0; i < 1; ++i) {
        resArr2[i] = static_cast<bool>(1) + static_cast<bool>(1);
      }
      testVec1Copy = testVec1;
      resVec = testVec1Copy++; // <------------------- Error

C++ requires that Outside a template, a discarded statement is fully checked. if constexpr is not a substitute for the #if preprocessing directive: https://en.cppreference.com/w/cpp/language/if

Faulty CTS test: https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-2020/tests/vector_operators/generate_vector_operators.py#L212

@uditagarwal97
Copy link
Contributor Author

@gmlueck FYI

@aelovikov-intel
Copy link
Contributor

Looks like it might have been fixed by #870.

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

No branches or pull requests

2 participants