Skip to content

SYCL: Implement some dependencies for SYCL 2020 Spec constant design #3499

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 3 commits into from
Apr 9, 2021

Conversation

erichkeane
Copy link
Contributor

The Spec-constant design (#3331) has a
few dependencies on the CFE, including generating unique names for
reachable specialization_id variables and putting the results in the
integration footer.

This patch helps with this effort in 2 ways:
First, it creates a command line option that will be used eventually to
ensure that types with internal linkage have names unique to this
translation unit. This will eventually be used by the
unique-id/unique-stable-name implementation, but is required as a CC1
option to unblock the Driver implementation.

Second, it generates the integration footer sans the generated names
(which will be added when we have the unique-id/unique-stable-name
implementation in place). This is necessary to unblock library
implementation of this feature.

The Spec-constant design (intel#3331) has a
few dependencies on the CFE, including generating unique names for
reachable specialization_id variables and putting the results in the
integration footer.

This patch helps with this effort in 2 ways:
First, it creates a command line option that will be used eventually to
ensure that types with internal linkage have names unique to this
translation unit.  This will eventually be used by the
unique-id/unique-stable-name implementation, but is required as a CC1
option to unblock the Driver implementation.

Second, it generates the integration footer sans the generated names
(which will be added when we have the unique-id/unique-stable-name
implementation in place).  This is necessary to unblock library
implementation of this feature.
std::array<DeclContextDesc, 3> Scopes = {
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "cl"},
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "sycl"},
Util::DeclContextDesc{Decl::Kind::ClassTemplateSpecialization, Name}};
Copy link
Contributor

Choose a reason for hiding this comment

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

2 minor questions here:
does this not need the clang:: namespace prefix?
can we not use the "specialization_id" literal here directly?

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 guess none of these need 'clang::'. I just copy/pasted from above :) Same as the using specialization_id here directly. I actually don't have a good reason for it being separate. I'll do some cleanup in THIS patch for this function, then do the rest in the other patch (#3504) for the rest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So hold off on merging this, i want #3504 to go first. THEN I need to merge with that and do a touch of refactoring of this part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, #3504 is in now, and has been merged with this. The changes you requested here have been done.

This patch should be ready for review (and presumably approval :) )?

@erichkeane
Copy link
Contributor Author

Ping @AaronBallman or @premanandrao . This should be ready for review now.

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

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.

LGTM!

@bader bader merged commit bc21ab2 into intel:sycl Apr 9, 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.

5 participants