Skip to content

[SYCL] Start fully-qualifying our inline kernel names in forward decl… #4220

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

Merged
merged 4 commits into from
Aug 3, 2021

Conversation

erichkeane
Copy link
Contributor

…arations.

This has the ability to make a number easy-to-make mistakes no longer
issues when using named kernels. This causes us to differentiate the
inline-named kernels when they are in different namespaces, which will
hopefully make running into duplicate-kernel-name issues more difficult.

…arations.

This has the ability to make a number easy-to-make mistakes no longer
issues when using named kernels.  This causes us to differentiate the
inline-named kernels when they are in different namespaces, which will
hopefully make running into duplicate-kernel-name issues more difficult.
@erichkeane
Copy link
Contributor Author

@AaronBallman

@erichkeane erichkeane marked this pull request as ready for review July 30, 2021 15:37
Copy link
Contributor

@elizabethandrews elizabethandrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks ok to me. Just had a couple of questions to clarify kernel naming requirements.

@erichkeane
Copy link
Contributor Author

a couple of questions

Which were?

@elizabethandrews
Copy link
Contributor

a couple of questions

Which were?

That's strange. My inline comments disappeared.....

// and
// namespace N2 { void foo() { kernel<class K>(...); }}
// to co-exist, despite technically being against the SYCL rules.
// See SYCLKernelNameTypePrinter for the corresponding part that prints
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to where this 'technically violates SYCL rules'? Also, what happens when the declarations are in the same namespace but the context is technically different? For e.g.

    // namespace N1 { void foo() { kernel<class K>(...); }}
    // and
    // namespace N1 { void bar() { kernel<class K>(...); }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is supposed to be part of this line:

The kernel name must be forward declarable at namespace scope (including global namespace scope) and may not be forward declared other than at namespace scope. If it isn’t forward declared but is specified as a template argument in a kernel invoking interface, as described in Section 4.9.4.2, then it may not conflict with a name in any enclosing namespace scope.

here: https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:naming.kernels

That at least prohibits your example (since they are the same name in the same enclosing namespace), but I don't know what prevents something like:

namespace N1 { void foo() { kernel<class K>(...); }}
namespace N2 { void foo() { kernel<class K>(...); }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexeySachkov : Can you help with the above standards interpretation there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Thank you for clarification

AaronBallman
AaronBallman previously approved these changes Aug 2, 2021
Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits from me, but otherwise LG.

Erich Keane and others added 2 commits August 2, 2021 08:49
@erichkeane
Copy link
Contributor Author

@bader : Looks like the Lit_With_Cuda bot is out of disk space?

Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bader
Copy link
Contributor

bader commented Aug 2, 2021

@bader : Looks like the Lit_With_Cuda bot is out of disk space?

Yes. I've seen this issue in my PR as well and I reported it already.
@DoyleLi, @tfzhu, FYI.

@bader
Copy link
Contributor

bader commented Aug 2, 2021

Yes. I've seen this issue in my PR as well and I reported it already.
@DoyleLi, @tfzhu, FYI.

FYI: I've disabled the machine with that problem to avoid future problems.
Now we have only one worker to process all the requests, but I hope there will be no "false negatives" anymore.

@bader
Copy link
Contributor

bader commented Aug 2, 2021

Also, I've restarted the Lit_With_Cuda job and results are expected in 1.5-2 hours.

@romanovvlad romanovvlad merged commit 5e8ad0a into intel:sycl Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants