Skip to content

[SYCL] Simplify check whether a header file is available for inclusion #19759

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

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from

Conversation

dyniols
Copy link
Contributor

@dyniols dyniols commented Aug 11, 2025

__has_include is part of the C++ standard since C++17: https://en.cppreference.com/w/cpp/preprocessor/include

We require C++17 if sycl.hpp is included, so we can use __has_include without extra checks for its presence.

@dyniols dyniols changed the title [SYCL] Simplify check whether a mdspan header file is available for inclusion [SYCL] Simplify check whether a mdspan header file is available for inclusion group_interface extension Aug 11, 2025
@dyniols dyniols changed the title [SYCL] Simplify check whether a mdspan header file is available for inclusion group_interface extension [SYCL] Simplify check whether a mdspan header file is available for inclusion group_interface extension Aug 11, 2025
@dyniols dyniols marked this pull request as ready for review August 11, 2025 16:47
@dyniols dyniols requested a review from a team as a code owner August 11, 2025 16:47
@dyniols dyniols requested a review from steffenlarsen August 11, 2025 16:47
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

While you're at it, could we apply the same to all other uses of defined(__has_include)? I see it in sycl/source/detail/os_util.cpp and sycl/include/syclcompat/kernel.hpp.

@dyniols
Copy link
Contributor Author

dyniols commented Aug 12, 2025

While you're at it, could we apply the same to all other uses of defined(__has_include)? I see it in sycl/source/detail/os_util.cpp and sycl/include/syclcompat/kernel.hpp.

Sure

@dyniols dyniols requested a review from a team as a code owner August 12, 2025 13:52
@dyniols dyniols requested a review from steffenlarsen August 12, 2025 13:53
@dyniols dyniols changed the title [SYCL] Simplify check whether a mdspan header file is available for inclusion group_interface extension [SYCL] Simplify check whether a header file is available for inclusion in SYCL files Aug 12, 2025
@dyniols dyniols changed the title [SYCL] Simplify check whether a header file is available for inclusion in SYCL files [SYCL] Simplify check whether a header file is available for inclusion Aug 12, 2025
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