-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Fix include loop and use-before-def #8407
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
Conversation
There are two issues present here that aren't obviously visible: 1. The `sycl::half_type` alias isn't defined in sycl/half_type.hpp; it actually comes from detail/generic_type_lists.hpp seemingly accidentally. 2. detail/type_traits.hpp transitively includes sycl/half_type.hpp as it has templates that use sycl::half. However, the half implementation itself needs type_traits.hpp for computing alignment. Depending on the order of headers included, this causes an unfulfillable declaration-before-use issue in client code. In doing so ESIMD was found to be guilty of not including all the correct headers. There are many such transitive header issues lurking which keep the headers tightly coupled and the final preprocess very large. Until they are solved in a more general way I've had to introduce some copy-paste for the `vector_alignment` helper to avoid including type_traits.hpp inside half_type.hpp. This patch is a prerequisite of the future complex_half group algorithms work ending up in a working order
a8982c1
to
e4b3590
Compare
detail/helpers.hpp was needed by spirv_ops.cpp for the inline definition of detail::memcpy, but including such caused a circular ordering issue. There's no need to forward declare an inline function that's immediately needed, so hoist it into its own header that can easily be included in both users.
If anyone has bandwidth to look at this I'd appreciate it; It's a prerequisite of making 7120 work |
@intel/llvm-gatekeepers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay! Just a small comment about the repeat code, but otherwise LGTM!
If reviewers are slow to react, please feel free to ping.
@intel/dpcpp-esimd-reviewers - Friendly ping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esimd.hpp lgtm
On Fri Mar 3, 2023 at 3:08 PM GMT, Steffen Larsen wrote:
Would it make sense to move this to a new file, e.g.
`vector_traits.hpp`, similar to what you did with memcpy? Hopefully that
should avoid problems in case we ever need to change this.
Yeah. That seems sensible and more consistent. I'll update
|
443255c
to
06830e7
Compare
06830e7
to
95728c8
Compare
Is it worth rerunning the HIP timeouts? |
Not at the moment. They are considered unsupported for now will be disabled with intel/llvm-test-suite#1639. |
There are two issues present here that aren't obviously visible:
sycl::half_type
alias isn't defined in sycl/half_type.hpp; it actually comes from detail/generic_type_lists.hpp seemingly accidentally.There are many such transitive header issues lurking which keep the headers tightly coupled and the final preprocess very large. Until they are solved in a more general way I've had to introduce some copy-paste for the
vector_alignment
helper to avoid including type_traits.hpp inside half_type.hpp.This patch is a prerequisite of the future complex_half group algorithms work ending up in a working order