-
Notifications
You must be signed in to change notification settings - Fork 777
[SYCL][Docs] Add design document for device aspect traits #8182
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][Docs] Add design document for device aspect traits #8182
Conversation
This commit adds a design document for the `any_device_has` and `all_devices_have` SYCL 2020 traits. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
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.
I think this is fine, but I added a comment about something that seemed a little confusing to me.
must assume that there exists some device that supports any given aspect. Since | ||
the driver has no way of knowing all possible aspects, we use a catch-all macro | ||
to denote this case instead. This is not needed for $A^{all}_t$ for any target | ||
$t$, as the driver will always know all relevant aspects. |
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.
This is kind of a minor point, but the last sentence seems a little confusing to me. It seems to me that the reason we do not need any special macro for the $A^{all}_t$
case is because $A^{all}_t$
is the empty set when there is no configuration entry for t
.
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.
Re-reading it, I completely agree. I have clarified it. Do you think it is clearer now?
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
${\bigcup}^n_{k=1} A^{any}_{tk}$ is the set of all aspects. | ||
* `__SYCL_ANY_DEVICE_HAS_`$j$`__` as `1` for all $j$ in | ||
${\bigcup}^n_{k=1} A^{any}_{tk}$ if `__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__` was not | ||
defined. |
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.
It's not clear to me - would these macros be set for device compilation only? Given usage, it does seem to be the case, but maybe call it out for clarity.
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.
They should be set for both host and device compilations.
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.
I tried clarifying this in 8f15db0.
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
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.
LGTM
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@maarquitos14 pointed out that the current design does not work if the the driver-controlled macros are undefined. As such the device headers should make sure they are defined if the driver does not define them. This has been amended in 93a5e80. |
Just curious ... why didn't the previous design work? Isn't |
It only worked if the macros were defined but without a value. When they were not defined, the preprocessor wouldn't think of them as macros and would leave them in. |
This commit adds a design document for the `any_device_has` and `all_devices_have` SYCL 2020 traits. --------- Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
This commit adds a design document for the
any_device_has
andall_devices_have
SYCL 2020 traits.