Skip to content

Consider providing an alternative to the monolith sycl/sycl.hpp header #780

@AlexeySachkov

Description

@AlexeySachkov

Extension Type

New Feature

Feature Description

sycl/sycl.hpp is the only header file that is documented by the SYCL 2020 specification meaning that users pay for everything in it even if use a small fraction of features. The cost is compilation time here.

The situation gets even worse with the addition of multiple extensions and what's even more concerning: KHR extensions do not propose their functionality in form of separate headers and their adoption is expected to go wider than just a single vendor implementation. They could even be included into the new versions of the core specification, thus introducing compile-time impact on everyone!

I will be talking about this issue on the upcoming IWOCL 2025, but I'm recording it here to be able to give a reference point for this issue in my slide deck.

Give me a week or so and I get back to you with more details and potentially a proposal of a potential sycl.hpp split.

To better illustrate the problem, take any compiler, your favorite SYCL implementation and compare compilation time of an empty file which includes bits/stdc++.h (non-standard header that includes all C++ STL) vs compilation time of an empty file that includes sycl/sycl.hpp.

Related Functionality in C++

C++ is designed with "you don't pay for what you don't use" in mind and therefore their standard library is split into separate headers so that user only includes what they actually need, without being forced to wait for parsing and analysis of effectively dead code.

Related Functionality in Other Languages

No response

Related SYCL Extensions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions