Skip to content

[NFC][SYCL] Add few vec tests to document current behavior #17720

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 3 commits into from
Apr 1, 2025

Conversation

aelovikov-intel
Copy link
Contributor

These will be updated as I upload PRs to implement recent specification changes.

These will be updated as I upload PRs to implement recent specification
changes.
// RUN: %clangxx -fsycl -fsyntax-only %s -fpreview-breaking-changes
// RUN: %clangxx -fsycl -fsyntax-only %s

#include <sycl/sycl.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we include the header with only sycl::vec type declarations (+half)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do have such policy for sycl/test-e2e but not here. IMO, it's wrong to selectively enforce it like that. If someone sees much value in not using sycl/sycl.hpp under sycl/test, then we need to clean up all existing tests and add a check that it's not added in new tests (like what I did for e2e tests).

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, it's wrong to selectively enforce it like that.

What do you mean by "selectively" enforce? Isn't it a general practice to write the smallest test. Basically, your test aims to test vector class functionality but instead includes the whole SYCL library. What is the value in that? The negative effect of including sycl/sycl.hpp is overhead on parsing a lot of C++ code unrelated to the tested functionality. Considering that developers are running these tests multiple times and CI is running these tests a lot, removing unnecessary overhead seems like a win to me.

If someone sees much value in not using sycl/sycl.hpp under sycl/test, then we need to clean up all existing tests and add a check that it's not added in new tests (like what I did for e2e tests).

I agree that we should enforce good practices either through code review or with tooling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think that individual non-official include is strictly better than sycl/sycl.hpp (because otherwise we wouldn't have had a similar discussion when I was proposing the opposite - using detail/core.hpp vs sycl/sycl.hpp in e2e tests). As such, without documented guidelines, it should be author's choice.

Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +22 to +24
// IN_PREVIEW_ONLY condition<>
// EXCEPT_IN_PREVIEW condition<>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moving discussion from #17712 (comment) to here.

@uditagarwal97 , can you review please?

@aelovikov-intel aelovikov-intel merged commit aa7dcb1 into intel:sycl Apr 1, 2025
23 checks passed
@aelovikov-intel aelovikov-intel deleted the vec-tests branch April 1, 2025 16:20
ggojska pushed a commit to ggojska/llvm that referenced this pull request Apr 7, 2025
…7720)

These will be updated as I upload PRs to implement recent specification
changes.
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.

4 participants