-
Notifications
You must be signed in to change notification settings - Fork 756
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] Allow use of function declarators with empty parentheses while trying to compile code for SYCL devices #1994
Conversation
…defined as templated function object where the template parameter is of enum type (scoped and unscoped). Eg: template <> struct KernelInfo<::dummy_functor_1<(no_namespace_int)0>> to template <> struct KernelInfo<::dummy_functor_1<static_cast<no_namespace_int>(0)>>
… from SYCL kernel In C language, declaring a function without any information about its parameters is allowed. However, SYCL kernel does not support calling a no-prototype function. This commit checks if a no-prototype function is present in device code and if found emits a deferred diagnostic error.
There is no such restriction in SYCL spec. It might be connected with spir targets that we use for device compilation. The following code:
compiles successfully with the command |
Thanks for the clarifications. |
Treat 'f()' as 'f(void)' rather than a function w/o a prototype.
If a no-prototype function f() is compiled for a SYCL device,then treat 'f()' as 'f(void)' rather than a function without a prototype.
@Fznamznon, does this look okay to you? |
LGTM |
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.
Your change doesn't do anything for C
anymore, please provide correct description and PR name.
Treat
foo()
function asfoo(void)
instead of a no-prototype function when code is compiled for SYCL devices.