add standalone_debug attribute to sycl::device class #19059
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A debug info optimization, known as "constructor homing," is enabled by default and omits debug information for certain constructors based on their characteristics. For the sycl::device class, the constructor is neither a copy/move constructor nor deleted, and is non-trivial, resulting in the omission of its debug information.
This omission causes the pretty printer to fail, as it requires the debug information to display essential details such as types and device names. To resolve this, the pull request introduces the standalone_debug attribute to the sycl::device class, ensuring that debug information is always emitted for this class.
While this change successfully addresses the pretty printer issue, it may lead to debug information being present in every compilation unit, potentially affecting code size. Testing with existing SYCL tests shows that the code size impact is relatively small, with increases ranging from approximately 0.6% to 1.5% in most cases.