-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][Graph] Implement dynamic local accessors #18437
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
base: sycl
Are you sure you want to change the base?
[SYCL][Graph] Implement dynamic local accessors #18437
Conversation
56eaa40
to
32945a2
Compare
00f1bbf
to
da31888
Compare
db1d142
to
19e107c
Compare
* Implements the dynamic_local_accessor class with compiler support. * Refactor the recently added dynamic_work_group_memory class to only use one impl member variable. This brings it closer to the design of other sycl classes and avoids future ABI break issues.
19e107c
to
cb78e9d
Compare
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.
Couple comments from a first pass
@@ -3520,7 +3519,14 @@ _ZN4sycl3_V17handler11saveCodeLocENS0_6detail13code_locationE | |||
_ZN4sycl3_V17handler11saveCodeLocENS0_6detail13code_locationEb | |||
_ZN4sycl3_V17handler11storeRawArgEPKvm | |||
_ZN4sycl3_V17handler12addReductionERKSt10shared_ptrIKvE | |||
_ZN4sycl3_V17handler12setArgHelperEiRNS0_3ext6oneapi12experimental6detail30dynamic_work_group_memory_baseE |
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.
There are breaking changed here from a symbols being removed, is it possible to avoid that with the preview macro to guard code that will be removed in the next ABI breaking window?
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.
Yes, I can make that change. I was hoping this wouldn't be needed since support for dynamic_work_group_memory was added very recently and the specification hasn't merged yet.
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.
ahh I missed that these were to dynamic_work_group_memory, I think your right that this shouldn't be an issue then, but can you highlight in the PR description why we don't think this ABI break is an issue.
{ | ||
} | ||
|
||
local_accessor<DataT, Dimensions> get() const { |
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.
In the spec PR I don't think we say this method is const, so that is something to update in the spec
|
||
SYCLIntegrationHeader::kernel_param_kind_t ParamKind = | ||
SYCLIntegrationHeader::kind_accessor; | ||
|
||
if (SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::dynamic_local_accessor)) { | ||
ParamKind = SYCLIntegrationHeader::kind_dynamic_accessor; | ||
} | ||
|
||
Header.addParamDesc(ParamKind, Info, |
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.
Nit, this could be made into ternary operator. Also same below.
SYCLIntegrationHeader::kernel_param_kind_t ParamKind = | |
SYCLIntegrationHeader::kind_accessor; | |
if (SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::dynamic_local_accessor)) { | |
ParamKind = SYCLIntegrationHeader::kind_dynamic_accessor; | |
} | |
Header.addParamDesc(ParamKind, Info, | |
SYCLIntegrationHeader::kernel_param_kind_t ParamKind = | |
SemaSYCL::isSyclType(FieldTy, SYCLTypeAttr::dynamic_local_accessor) | |
? SYCLIntegrationHeader::kind_dynamic_accessor | |
: SYCLIntegrationHeader::kind_accessor; | |
Header.addParamDesc(ParamKind, Info, |
@@ -623,9 +629,15 @@ __SYCL_TYPE(dynamic_work_group_memory) dynamic_work_group_memory | |||
/// @param Graph The graph associated with this object. | |||
/// @param Num Number of elements in the unbounded array DataT. | |||
dynamic_work_group_memory( | |||
experimental::command_graph<graph_state::modifiable> Graph, size_t Num) | |||
[[maybe_unused]] experimental::command_graph<graph_state::modifiable> |
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.
If some of the jenkins jobs are still using gcc 7.5, then those [[maybe_unused]]
in the constructor will cause a failure because of a gcc bug, see #17736
But I guess it will show up on the pre-commit CI too. Maybe the gcc version was bumped already.
@@ -1802,20 +1837,37 @@ class __SYCL_EXPORT handler { | |||
// set_arg for graph dynamic_parameters | |||
template <typename T> | |||
void set_arg(int argIndex, | |||
ext::oneapi::experimental::dynamic_parameter<T> &dynamicParam) { | |||
[[maybe_unused]] ext::oneapi::experimental::dynamic_parameter<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.
Why [[maybe_unused]]
here?
impl
member variable. This brings it closer to the design of other sycl classes and avoids future ABI break issues.dynamic_work_group_memory
class whose specification has not been merged yet and is not yet officially supported.