Intel DPC++ and [[no_unique_address]
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 507
- Forks
- 87
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 2
Description
Hi,
The latest Intel DPC++ compiler supports C++20 and [[no_unique_address]] attribute, however it does not support feature testing of the [[no_unique_address]] attribute.
When compiling SYCL source code using mdspan with DPC++ and /std:c++20,
MDSPAN_HAS_CXX_20 is true, but
((__has_cpp_attribute(no_unique_address) >= 201803L)) is false.
Because of this, _MDSPAN_USE_ATTRIBUTE_NO_UNIQUE_ADDRESS and _MDSPAN_NO_UNIQUE_ADDRESS macros in __p0009_bits/config.hpp will not be correctly defined in SYCL host code, causing compilation errors.
Please see https://community.intel.com/t5/Intel-oneAPI-Data-Parallel-C/Failed-to-use-mdspan-in-SYCL-kernel-code/m-p/1542689 for discussion on the errors.
I think SYCL Unified Shared Memory (USM) is one of the most important use cases of mdspan, and DPC++ is one of the best SYCL compilers, so it would be nice to have a workaround for that compiler.
Thanks,
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with __p0009_bits/config.hpp and inspect how _MDSPAN_USE_ATTRIBUTE_NO_UNIQUE_ADDRESS and _MDSPAN_NO_UNIQUE_ADDRESS depend on __has_cpp_attribute. Reproduce the issue with Intel DPC++ using SYCL, mdspan, and /std:c++20, referring to the linked Intel discussion for the reported errors. Done means SYCL host code compiles when DPC++ supports [[no_unique_address]] without reporting the attribute through feature testing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100