Skip to content

[SYCL][OpenMP] Correctly handle __bf16 intrinsics using deferred diagnostics #8116

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
Jan 30, 2023

Conversation

elizabethandrews
Copy link
Contributor

@elizabethandrews elizabethandrews commented Jan 26, 2023

Commits 1 and 2 are cherry-picks from llvm.org - https://reviews.llvm.org/D141375 and https://reviews.llvm.org/rGc10615e4a94fc8dec65a48a6eb8f7efccc3fb1fc.

Commit 3 reverts header changes made in intel/llvm.

This patch uses existing deferred diagnostics framework to emit error
for unsupported type __bf16 in device code. Error is not emitted in
host code.

Differential Revision: https://reviews.llvm.org/D141375
@elizabethandrews elizabethandrews requested a review from a team as a code owner January 26, 2023 22:03
@elizabethandrews elizabethandrews temporarily deployed to aws January 26, 2023 22:33 — with GitHub Actions Inactive
@elizabethandrews elizabethandrews temporarily deployed to aws January 26, 2023 23:04 — with GitHub Actions Inactive
@bader
Copy link
Contributor

bader commented Jan 27, 2023

Please, follow https://github.com/intel/llvm/blob/sycl/CONTRIBUTING.md#pull-request recommendations for PR decoration. E.g. PR title "Correctly handle __bf16 intrinsics using deferred diagnostics" -> "[SYCL][OpenMP] Use deferred diagnostics to handle __bf16".

@elizabethandrews elizabethandrews changed the title Correctly handle __bf16 intrinsics using deferred diagnostics [SYCL][OpenMP] Correctly handle __bf16 intrinsics using deferred diagnostics Jan 27, 2023
@elizabethandrews
Copy link
Contributor Author

@intel/llvm-gatekeepers this patch is ready for review and merge. Failing test is unrelated to this PR

@steffenlarsen
Copy link
Contributor

Failed Tests (1):
SYCL :: dword_atomic_smoke.cpp
Since fixed in intel/llvm-test-suite#1552

@steffenlarsen steffenlarsen merged commit 51568f7 into intel:sycl Jan 30, 2023
__bf16 var; // expected-note {{'var' defined here}}
kernel<class variables>([=]() {
(void)var; // expected-error {{'var' requires 16 bit size '__bf16' type support, but target 'spir64' does not support it}}
int B = sizeof(__bf16);
Copy link
Contributor

Choose a reason for hiding this comment

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

(Sorry, this is late. My notifications weren't working.)

Maybe a nit. Why is this declaration of B needed? Or is this showing that it does not get a diagnostic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I added it to show we don't get a diagnostic when used in unevaluated context

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