-
Notifications
You must be signed in to change notification settings - Fork 738
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
[SYCL][COMPLEX] Split complex header file and tests into multiple files #11600
[SYCL][COMPLEX] Split complex header file and tests into multiple files #11600
Conversation
Splitting itself looks good to me. I have just one NIT concern that users will have to include header files from |
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.
@jle-quel It seems that several e2e tests need to updated to include complex header from the new path. Could you please take a look.
We should definitely not expose "detail" to users. User-visible header files should be outside of this directory. If you are exposing several sub-header files, are you also documenting which functions are contained in each one? Are these headers big enough to merit breaking them down into smaller units? |
Thank you for your feedbacks. First of all, I want to make sure that I understand you:
Also, users will not have to include header files from Lastly, where would you want to see such documentation? If the split looks good to you, but the directory |
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.
Change in syclcompat/util.hpp
LGTM
The name "detail" is the problem. We want to teach people that anything named "detail" is an implementation detail and not part of a specification. If you do want to expose sub-headers, I'd suggest the naming pattern
We should not expose this extension via a set of headers just because we can. There should be some justification for doing it this way. The names of the headers are part of the extension API, so they must be documented in the extension specification. |
Very well, how about:
Even though I prefer component to be (if possible) broke down to their smaller units, it solves the breaking down into smaller units problems that you mentionned and also solves, the "detail" naming rule. Quick note about why I prefer smaller component, when you include a header, I expect to include the strict minimum, which is something that sycl does not really do (I stumble upon doing this refacto, where including Of course, this will be updated in the complex and marray, and soon to be group algorithm specification. However, this makes the complex API fit into multiple header files. |
I prefer the directory name "detail" over "common" when the directory contains implementation details (i.e. headers that the user is not supposed to include themselves). BTW, I wasn't thinking about the extension prefix for the header file before. The full include path for the headers should be like Can you remind me which PR adds marray support to the specification? It looks like the version in the main branch (sycl_ext_oneapi_complex) does not have marray support. |
I got that implicitly, the Do we agree with this one (with full path) and without a single header file that includes them all?
|
Oh, I was thinking that <complex/complex.hpp> would have all the support. Don't you think some people will want the simplicity of a single header? |
So to bring back some context, @steffenlarsen and I agreed about splitting the header files since it contained multiple extensions into multiple header files. Of course, and that's why I proposed this PR in the first place, which split everything into smaller header files (maybe too much from your feedback), and most importantly, From the user's perspective, he would still have the simplicity of a single header file. |
I guess I'm confused about what you are proposing, then. From a user's perspective, what header files are exposed as part of the specification? Which headers must an application include in order to use these APIs? |
I totally agree. I didn't measure the cyclomatic complexity of SYCL API formally, but my gut feeling says that it's very high (backed up by my experiments with reducing the amount of code included with
It also helps with the compile time, which is an issue by itself for DPC++. |
I'm proposing an internal re-structure of the complex API. From a user's perspective, the header file exposed to me as well as the header needed to use this API is solely:
Now I understand that the name of the directory |
I was confused about your proposal before, and I no longer think the name "detail" is a problem. My concern is only about documenting headers in the "detail" directory. We don't want to tell users that they need to include some "detail" header. However, it seems like that's not what you are proposing. Users include "sycl/ext/oneapi/experimental/complex/complex.hpp", and that header internally includes things from "detail". That's totally fine. In fact, this is an excellent use for the name "detail". |
…es (#11600) This PR is the first step toward restructuring the `complex` API. As discussed in #8647 and #10854, the goal here is to clean the future-to-be `complex` API. To simplify the review of these changes, a new PR (this PR) is created to not overload #8647. IF/WHEN this will be approved, the second step which does the same for the `marray`'s complex specialization will be pushed onto #8647 Here's an overview of what has changed: For the users, the only change is the include. Instead of including `<sycl/ext/oneapi/experimental/sycl_complex.hpp>`, it will now be `<sycl/ext/oneapi/experimental/complex/complex.hpp>` The `complex.hpp` header files include all the `complex/detail` header file (the `complex` API), in order to abstract the headers needed for the users. However, the users can include (if necessary) the specific component of the API located in `complex/detail`. Here's the overview of what the complex directory will contain when the whole API is merged. ``` - complex - complex.hpp - detail - complex.hpp - complex_math.hpp - complex_group_algorithm.hpp - marray.hpp - marray_math.hpp - marray_group_algorithm.hpp - common.hpp ``` Finally, here's the overview of the `sycl/test/extension` ``` - complex - complex.cpp - marray.cpp ```
This PR is the first step toward restructuring the
complex
API.As discussed in #8647 and #10854, the goal here is to clean the future-to-be
complex
API.To simplify the review of these changes, a new PR (this PR) is created to not overload #8647.
IF/WHEN this will be approved, the second step which does the same for the
marray
's complex specialization will be pushed onto #8647Here's an overview of what has changed:
For the users, the only change is the include.
Instead of including
<sycl/ext/oneapi/experimental/sycl_complex.hpp>
, it will now be<sycl/ext/oneapi/experimental/complex/complex.hpp>
The
complex.hpp
header files include all thecomplex/detail
header file (thecomplex
API), in order to abstract the headers needed for the users.However, the users can include (if necessary) the specific component of the API located in
complex/detail
.Here's the overview of what the complex directory will contain when the whole API is merged.
Finally, here's the overview of the
sycl/test/extension
@gmlueck @steffenlarsen