Skip to content

[SYCL] Replace hardcoded namespaces with attribute #6674

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 7 commits into from
Sep 6, 2022

Conversation

elizabethandrews
Copy link
Contributor

@elizabethandrews elizabethandrews commented Aug 30, 2022

Namespaces were hardcoded and used in compiler to
check for various SYCL types including accessors,
spec_constants, etc. This patch implements an
attribute to uniquely identify the types instead.
Attribute argument is an Identifier which denotes
each type.

E.g. attribute((sycl_type(accessor)) is used
to mark accessor class.

The attribute has been implemented as with an
accepted list of arguments via EnumArg. The attribute
definition should be updated to support any new types.

The attribute takes 1 argument.

Fixes: #5186

Namespaces were hardcoded and used in compiler to
check for various SYCL types including accessors,
spec_constants, etc. This patch implements an
attribute to uniquely identify the types instead.
Attribute argument is an Identifier which denotes
each type.

E.g. __attribute__((sycl_type(accessor)) is used
to mark accessor class.

The attribite has been implemented as with an
accepted list of arguments via EnumArg. The attribute
definition should be updated to support any new types.

The attribute takes 1 argument.

Signed-off-by: Elizabeth Andrews <[email protected]>
Signed-off-by: Elizabeth Andrews <[email protected]>
Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

I believe this one will fix #5186 .

Signed-off-by: Elizabeth Andrews <[email protected]>
Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

Just a couple of nits to the tests, otherwise LGTM.

Signed-off-by: Elizabeth Andrews <[email protected]>
Fznamznon
Fznamznon previously approved these changes Sep 1, 2022
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.

Just nits, except in one place. Otherwise, looks good.

Signed-off-by: Elizabeth Andrews <[email protected]>
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

LGTM! Great improvement!

For the future, should we consider removing __sycl_detail__::device_global in favor of a device_global enum for __sycl_detail__::sycl_type?

@elizabethandrews
Copy link
Contributor Author

LGTM! Great improvement!

For the future, should we consider removing __sycl_detail__::device_global in favor of a device_global enum for __sycl_detail__::sycl_type?

I don't see why not. I can do that in a follow-up PR.

@elizabethandrews
Copy link
Contributor Author

elizabethandrews commented Sep 1, 2022

The failing CUDA test suite looks like an infrastructure issue.

@elizabethandrews
Copy link
Contributor Author

The failing CUDA test suite looks like an infrastructure issue.

I see the following test failing -

TEST 'SYCL :: Plugin/level_zero_events_caching.cpp

Is this a known issue? I haven't looked carefully at this but it may not be related to my patch because all tests passed for the first patch I pushed, and none of the subsequent changes should introduce new failures

@steffenlarsen
Copy link
Contributor

The failing CUDA test suite looks like an infrastructure issue.

I see the following test failing -

TEST 'SYCL :: Plugin/level_zero_events_caching.cpp

Is this a known issue? I haven't looked carefully at this but it may not be related to my patch because all tests passed for the first patch I pushed, and none of the subsequent changes should introduce new failures

I haven't seen that failure before. @againull | @smaslov-intel - Is this a known failure?

Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

Thanks!
I still think that it's possible to come up with unified interface to handle all SYCL classes the same way, so we should be able to drop attribute argument in the future.

@elizabethandrews
Copy link
Contributor Author

@intel/llvm-gatekeepers I don't believe the fails have anything to do with this PR. CUDA suite seems to be having some infrastructure issues. SYCL :: DeviceLib/assert.cpp did not fail when I ran the test on earlier. There have been no new commits/changes since then in this PR

@steffenlarsen
Copy link
Contributor

Failing OCL x64 was a known issue and has since been fixed. CUDA failure does indeed look to be infrastructure-related.

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.

[NFC] Refactor Util class in SemaSYCL to be reusable.
8 participants