-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Disable warning for attributes applied to non-kernel functors #15581
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?
Conversation
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.
How is this different from raising the warning on functions which are never called from a kernel? Should be be raising this warning on only those functions which are called from the kernel so you don't have random warnings generated for functions never even called?
Free functions are not usable as kernels and these warnings should be issues when applying the attribute to anything that is not recognizably a kernel function. The problem with functors are that they could be defined in common headers, while only actually being used in some source files, which means for all other source files they would issue a warning, even if they are not being used in those source files.
That is not completely true, but we may want to refine once we know how we apply these attributes to free functions in the extensions allowing these. Tag @AlexeySachkov for comment. |
With this new change, a non-kernel functor with this attribute invoked inside the kernel will not generate this warning and I am pretty certain nested lambdas will have the same issue. The more I think about it, I think it makes sense to only generate this warning only on functions called within the kernel. Why does it matter if the attribute is used on functions if there are never invoked in the kernel. It also would keep the behavior consistent between functions and lambdas and functors instead of diverging this way. |
Sure, I can change implementation. I assume you mean to issue warnings only in the device-code path? |
Yes I think that makes more sense here unless @steffenlarsen disagrees. |
It does change the intention of the warning slightly, but I agree that with the exclusions we have to make to avoid user confusion it makes perfect sense to make it just a device-code path check. |
|
This pull request is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days. |
The reason for this change is to avoid confusing when diagnostic is issued for functors that are defined but not used.