Skip to content
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

[SYCL] Fix Ambiguity in Overloaded Unary Minus Operator for bfloat16 #15393

Merged
merged 27 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2457447
[SYCL][FPGA] Allow tablegen handle mutually exclusive decl attrs (SYC…
smanna12 Mar 26, 2024
7b7a5f3
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Mar 26, 2024
e41aacc
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Mar 28, 2024
ceb0eab
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Jun 27, 2024
4d9dfa1
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Jun 28, 2024
c133d97
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Jul 3, 2024
76b7e48
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Jul 13, 2024
feaa623
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Jul 16, 2024
d29de7e
[SYCL] Fix group algorithms for non-uniform groups, marray and vec (#…
steffenlarsen Jul 16, 2024
de655a3
[SYCL][NVPTX] Emit reqd_work_group_size attributes as NVVM annotation…
frasercrmck Jul 16, 2024
4d1ef3a
[SYCL][Test] Add test for ABI-neutrality of sycl classes (#14558)
againull Jul 16, 2024
0c368b1
[SYCL][NFCI][ABI-Break] Move handler members to impl (#14460)
steffenlarsen Jul 16, 2024
3657bd9
[CI] Make Windows LIT_OPTS match Linux (#14583)
sarnex Jul 16, 2024
137fd1f
[SYCL][ABI-Break] Fold host_half_impl::half into half_impl::half (#13…
steffenlarsen Jul 16, 2024
89a4e16
[SYCL][E2E] Fix two Windows ocloc tests (#14560)
sarnex Jul 16, 2024
019d080
[UR] Bump main tag to 7e38af77 (#14552)
kbenzie Jul 16, 2024
8f8644c
[SYCL] Make swizzle mutating operators const friends (#13012)
steffenlarsen Jul 16, 2024
94a10a6
[SYCL] kernel_compiler include file paths collision fix (#14490)
cperkinsintel Jul 16, 2024
5401bac
[NFC][SYCL] Update tests to reflect new offload model (#14539)
mdtoguchi Jul 16, 2024
ac20312
[SYCL][E2E] Remove XFAIL from tests; fix multi-device config (#14571)
frasercrmck Jul 16, 2024
c4fdc92
[FPGA] [CodeGen][NFC] Enhance Intel FPGA annotation function and opti…
smanna12 Jul 16, 2024
4148548
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Aug 15, 2024
3856438
Merge remote-tracking branch 'my_remote/sycl' into sycl
smanna12 Sep 13, 2024
a78dc15
[SYCL] Fix Ambiguity in Overloaded Unary Minus Operator for bfloat16
smanna12 Sep 13, 2024
6a65b8f
Fix wrong merge conflicts
smanna12 Sep 13, 2024
4802b39
Fix wrong merge conflicts
smanna12 Sep 13, 2024
b9dea3e
Fix test failure
smanna12 Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/include/sycl/ext/oneapi/bfloat16.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class bfloat16 {
explicit operator bool() { return to_float(value) != 0.0f; }

// Unary minus operator overloading
friend bfloat16 operator-(bfloat16 &lhs) {
friend bfloat16 operator-(const bfloat16 &lhs) {
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__) && \
(__SYCL_CUDA_ARCH__ >= 800)
detail::Bfloat16StorageT res;
Expand Down
12 changes: 6 additions & 6 deletions sycl/test/check_device_code/vector/vector_math_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,26 +341,26 @@ SYCL_EXTERNAL auto TestNegation(vec<ext::oneapi::bfloat16, 3> a) { return !a; }
// CHECK-NEXT: [[REF_TMP_I:%.*]] = alloca float, align 4
// CHECK-NEXT: [[A_ASCAST:%.*]] = addrspacecast ptr [[A]] to ptr addrspace(4)
// CHECK-NEXT: tail call void @llvm.experimental.noalias.scope.decl(metadata [[META100:![0-9]+]])
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr nonnull [[REF_TMP_I]])
// CHECK-NEXT: [[REF_TMP_ASCAST_I:%.*]] = addrspacecast ptr [[REF_TMP_I]] to ptr addrspace(4)
// CHECK-NEXT: tail call void @llvm.memset.p4.i64(ptr addrspace(4) noundef align 32 dereferenceable(32) [[AGG_RESULT]], i8 0, i64 32, i1 false), !alias.scope [[META100]]
// CHECK-NEXT: [[REF_TMP_ASCAST_I:%.*]] = addrspacecast ptr [[REF_TMP_I]] to ptr addrspace(4)
// CHECK-NEXT: br label [[FOR_COND_I:%.*]]
// CHECK: for.cond.i:
// CHECK-NEXT: [[I_0_I:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC_I:%.*]], [[FOR_BODY_I:%.*]] ]
// CHECK-NEXT: [[CMP_I:%.*]] = icmp ult i64 [[I_0_I]], 16
// CHECK-NEXT: br i1 [[CMP_I]], label [[FOR_BODY_I]], label [[_ZN4SYCL3_V16DETAILNGERKNS0_3VECINS0_3EXT6ONEAPI8BFLOAT16ELI16EEE_EXIT:%.*]]
// CHECK: for.body.i:
// CHECK-NEXT: [[ARRAYIDX_I_I_I_I:%.*]] = getelementptr inbounds [16 x %"class.sycl::_V1::ext::oneapi::bfloat16"], ptr addrspace(4) [[A_ASCAST]], i64 0, i64 [[I_0_I]]
// CHECK-NEXT: [[CALL_I_I_I:%.*]] = call spir_func noundef float @__devicelib_ConvertBF16ToFINTEL(ptr addrspace(4) noundef align 2 dereferenceable(2) [[ARRAYIDX_I_I_I_I]]) #[[ATTR8]], !noalias [[META100]]
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr nonnull [[REF_TMP_I]])
// CHECK-NEXT: [[CALL_I_I_I:%.*]] = call spir_func float @__devicelib_ConvertBF16ToFINTEL(ptr addrspace(4) noundef align 2 dereferenceable(2) [[ARRAYIDX_I_I_I_I]]) #[[ATTR8]], !noalias [[META103:![0-9]+]]
// CHECK-NEXT: [[FNEG_I:%.*]] = fneg float [[CALL_I_I_I]]
// CHECK-NEXT: store float [[FNEG_I]], ptr [[REF_TMP_I]], align 4, !tbaa [[TBAA47]], !noalias [[META100]]
// CHECK-NEXT: store float [[FNEG_I]], ptr [[REF_TMP_I]], align 4, !tbaa [[TBAA47]], !noalias [[META103]]
// CHECK-NEXT: [[CALL_I_I10_I:%.*]] = call spir_func noundef zeroext i16 @__devicelib_ConvertFToBF16INTEL(ptr addrspace(4) noundef align 4 dereferenceable(4) [[REF_TMP_ASCAST_I]]) #[[ATTR8]], !noalias [[META103]]
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr nonnull [[REF_TMP_I]])
// CHECK-NEXT: [[ARRAYIDX_I_I_I9_I:%.*]] = getelementptr inbounds [16 x %"class.sycl::_V1::ext::oneapi::bfloat16"], ptr addrspace(4) [[AGG_RESULT]], i64 0, i64 [[I_0_I]]
// CHECK-NEXT: [[CALL_I_I10_I:%.*]] = call spir_func noundef zeroext i16 @__devicelib_ConvertFToBF16INTEL(ptr addrspace(4) noundef align 4 dereferenceable(4) [[REF_TMP_ASCAST_I]]) #[[ATTR8]], !noalias [[META100]]
// CHECK-NEXT: store i16 [[CALL_I_I10_I]], ptr addrspace(4) [[ARRAYIDX_I_I_I9_I]], align 2, !tbaa [[TBAA103:![0-9]+]], !alias.scope [[META100]]
// CHECK-NEXT: [[INC_I]] = add nuw nsw i64 [[I_0_I]], 1
// CHECK-NEXT: br label [[FOR_COND_I]], !llvm.loop [[LOOP105:![0-9]+]]
// CHECK: _ZN4sycl3_V16detailngERKNS0_3vecINS0_3ext6oneapi8bfloat16ELi16EEE.exit:
// CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr nonnull [[REF_TMP_I]])
// CHECK-NEXT: ret void
//
SYCL_EXTERNAL auto TestMinus(vec<ext::oneapi::bfloat16, 16> a) { return -a; }
Loading