Skip to content

[CI] Uplift clang 13->15 in post-commit #7672

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 1 commit into from
Dec 20, 2022
Merged

Conversation

pvchupin
Copy link
Contributor

@pvchupin pvchupin commented Dec 7, 2022

Update post-commit task where we build SYCL toolchain with clang instead of GCC

@pvchupin pvchupin requested a review from a team as a code owner December 7, 2022 00:54
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.

Let's see if focal has clang-15. If not, we can combine this change with #7671.

@pvchupin
Copy link
Contributor Author

pvchupin commented Dec 7, 2022

Let's see if focal has clang-15. If not, we can combine this change with #7671.

It has it seems: https://apt.llvm.org/focal/dists/

@bader
Copy link
Contributor

bader commented Dec 8, 2022

@pvchupin, any idea what's going on with pre-commit here? GitHub glitch?

I see that pre-commit has been restarted. Sorry for the noise.

@pvchupin
Copy link
Contributor Author

pvchupin commented Dec 8, 2022

@pvchupin, any idea what's going on with pre-commit here? GitHub glitch?

I see that pre-commit has been restarted. Sorry for the noise.

Yep. I've restarted it manually after post-commit become green again.

@pvchupin
Copy link
Contributor Author

pvchupin commented Dec 9, 2022

Had to rebase, because post-commit is not using the current head of the repo.

@bader
Copy link
Contributor

bader commented Dec 9, 2022

Had to rebase, because post-commit is not using the current head of the repo.

Still fails. Is it due to compiler update or just unfortunate commit? I see that post-commit has been failing recently.

@pvchupin
Copy link
Contributor Author

pvchupin commented Dec 9, 2022

I think this is real this time, i.e. related to compiler update. I haven't see this issue in other post-commits.

@pvchupin
Copy link
Contributor Author

@zahiraam, can you take a look?

/home/runner/work/llvm/llvm/build/include/sycl/stream.hpp:744:21: error: 'sycl_special_class' attribute ignored [-Werror,-Wignored-attributes]
class __SYCL_EXPORT __SYCL_SPECIAL_CLASS __SYCL_TYPE(stream) stream
                    ^
/home/runner/work/llvm/llvm/build/include/sycl/detail/defines.hpp:25:45: note: expanded from macro '__SYCL_SPECIAL_CLASS'
#define __SYCL_SPECIAL_CLASS __attribute__((sycl_special_class))

Problem here is that clang-15 recognizes sycl_special_class attribute by __has_attribute(sycl_special_class), but why "attribute ignored" warning is produced?

Related to https://reviews.llvm.org/D114483

@pvchupin
Copy link
Contributor Author

Tagging @intel/dpcpp-cfe-reviewers

@zahiraam
Copy link
Contributor

@zahiraam, can you take a look?

/home/runner/work/llvm/llvm/build/include/sycl/stream.hpp:744:21: error: 'sycl_special_class' attribute ignored [-Werror,-Wignored-attributes]
class __SYCL_EXPORT __SYCL_SPECIAL_CLASS __SYCL_TYPE(stream) stream
                    ^
/home/runner/work/llvm/llvm/build/include/sycl/detail/defines.hpp:25:45: note: expanded from macro '__SYCL_SPECIAL_CLASS'
#define __SYCL_SPECIAL_CLASS __attribute__((sycl_special_class))

Problem here is that clang-15 recognizes sycl_special_class attribute by __has_attribute(sycl_special_class), but why "attribute ignored" warning is produced?

Related to https://reviews.llvm.org/D114483

This diff should fix the issue:
sh-3.2$ git diff
diff --git a/sycl/include/sycl/detail/defines.hpp b/sycl/include/sycl/detail/defines.hpp
index 23df19ce4b28..3f6c392baf5a 100644
--- a/sycl/include/sycl/detail/defines.hpp
+++ b/sycl/include/sycl/detail/defines.hpp
@@ -21,8 +21,8 @@
#endif
#endif

-#if __has_attribute(sycl_special_class)
-#define __SYCL_SPECIAL_CLASS attribute((sycl_special_class))
+#if __has_attribute(sycl_special_class) && (defined SYCL_DEVICE_ONLY)
+#define __SYCL_SPECIAL_CLASS attribute((sycl_special_class))
#else
#define __SYCL_SPECIAL_CLASS
#endif
sh-3.2$

I am still in the process of testing it. But if you are pressed for time, you might want to cherry pick this and see if that fixes the build issue with clang-15?

@pvchupin
Copy link
Contributor Author

pvchupin commented Dec 15, 2022

) && (defined SYCL_DEVICE_ONLY)

I confirm it works. I can submit a PR unless you already did.
UPD: Submitted at #7804

pvchupin pushed a commit to pvchupin/llvm that referenced this pull request Dec 15, 2022
Fixes unrecognized attribute warning when code is compiled in C++ mode.
Discovered at intel#7672.
Update post-commit task where we build SYCL toolchain with clang instead
of GCC
@pvchupin
Copy link
Contributor Author

The only task "Linux + Clang + Shared libs (pull_request)" for this change is clean. Merging in.

@pvchupin pvchupin merged commit 702eca0 into intel:sycl Dec 20, 2022
@pvchupin pvchupin deleted the clang-15 branch December 20, 2022 01:12
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.

3 participants