Skip to content

Commit ca8cb53

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (4 commits)
2 parents 6eae6b9 + 05740cc commit ca8cb53

File tree

8 files changed

+228
-122
lines changed

8 files changed

+228
-122
lines changed

devops/dependencies.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
2020
},
2121
"level_zero": {
22-
"github_tag": "v1.15.8",
23-
"version": "v1.15.8",
24-
"url": "https://github.com/oneapi-src/level-zero/releases/tag/v1.15.8",
22+
"github_tag": "v1.15.13",
23+
"version": "v1.15.13",
24+
"url": "https://github.com/oneapi-src/level-zero/releases/tag/v1.15.13",
2525
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
2626
},
2727
"tbb": {

llvm/lib/SYCLLowerIR/LowerWGScope.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,7 @@ static void copyBetweenPrivateAndShadow(Value *L, GlobalVariable *Shadow,
405405
assert(T && "Unexpected type");
406406

407407
if (T->isAggregateType()) {
408-
// TODO: we should use methods which directly return MaybeAlign once such
409-
// are added to LLVM for AllocaInst and GlobalVariable
410-
auto ShdAlign = MaybeAlign(Shadow->getAlignment());
408+
auto ShdAlign = Shadow->getAlign();
411409
Module &M = *Shadow->getParent();
412410
auto SizeVal = M.getDataLayout().getTypeStoreSize(T);
413411
auto Size = ConstantInt::get(getSizeTTy(M), SizeVal);

sycl/include/sycl/builtins_preview.hpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,22 @@ auto builtin_default_host_impl(FuncTy F, const Ts &...x) {
170170
template <typename FuncTy, typename... Ts>
171171
auto builtin_delegate_to_scalar(FuncTy F, const Ts &...x) {
172172
using T = typename first_type<Ts...>::type;
173-
if constexpr (is_vec_or_swizzle_v<T>) {
174-
using ret_elem_type = decltype(F(x[0]...));
175-
// TODO: using r{} to avoid Werror. Not sure if ok.
176-
vec<ret_elem_type, T::size()> r{};
177-
loop<T::size()>([&](auto idx) { r[idx] = F(x[idx]...); });
178-
return r;
173+
static_assert(is_vec_or_swizzle_v<T> || is_marray_v<T>);
174+
175+
constexpr auto Size = T::size();
176+
using ret_elem_type = decltype(F(x[0]...));
177+
std::conditional_t<is_marray_v<T>, marray<ret_elem_type, Size>,
178+
vec<ret_elem_type, Size>>
179+
r{};
180+
181+
if constexpr (is_marray_v<T>) {
182+
for (size_t i = 0; i < Size; ++i)
183+
r[i] = F(x[i]...);
179184
} else {
180-
static_assert(is_marray_v<T>);
181-
return builtin_marray_impl(F, x...);
185+
loop<Size>([&](auto idx) { r[idx] = F(x[idx]...); });
182186
}
187+
188+
return r;
183189
}
184190

185191
template <typename T>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t_preview.out %}
4+
// RUN: %if preview-breaking-changes-supported %{ %{run} %t_preview.out%}
5+
6+
#include <sycl/sycl.hpp>
7+
8+
int main() {
9+
using namespace sycl;
10+
queue q;
11+
12+
auto Test = [&](auto F, auto Expected, auto... Args) {
13+
std::tuple ArgsTuple{Args...};
14+
auto Result = std::apply(F, ArgsTuple);
15+
static_assert(std::is_same_v<decltype(Expected), decltype(Result)>);
16+
17+
auto Equal = [](auto x, auto y) {
18+
for (size_t i = 0; i < x.size(); ++i)
19+
if (x[i] != y[i])
20+
return false;
21+
22+
return true;
23+
};
24+
25+
assert(Equal(Result, Expected));
26+
27+
buffer<bool, 1> ResultBuf{1};
28+
q.submit([&](handler &cgh) {
29+
accessor Result{ResultBuf, cgh};
30+
cgh.single_task([=]() {
31+
auto R = std::apply(F, ArgsTuple);
32+
static_assert(std::is_same_v<decltype(Expected), decltype(R)>);
33+
Result[0] = Equal(R, Expected);
34+
});
35+
});
36+
assert(host_accessor{ResultBuf}[0]);
37+
};
38+
39+
{
40+
// Test upsample:
41+
auto Upsample = [](auto... xs) { return upsample(xs...); };
42+
Test(Upsample, marray<int16_t, 2>{0x203, 0x302}, marray<int8_t, 2>{2, 3},
43+
marray<uint8_t, 2>{3, 2});
44+
Test(Upsample, marray<uint16_t, 2>{0x203, 0x302}, marray<uint8_t, 2>{2, 3},
45+
marray<uint8_t, 2>{3, 2});
46+
}
47+
48+
return 0;
49+
}
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
//==--joint_matrix_bfloat16_rowmajorA_rowmajorB.cpp - DPC++ joint_matrix---==//
1+
//==--------joint_matrix_rowmajorA_rowmajorB.cpp - DPC++ joint_matrix------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
// REQUIRES: matrix
8+
// This tests support of row major layout for matrix B which does automatic VNNI
9+
// REQUIRES: aspect-ext_intel_matrix
910
// REQUIRES-INTEL-DRIVER: lin: 27501, win: 101.4943
11+
// VNNI transform and sub-group size 32 are not supported yet on DG2 by IGC
12+
// UNSUPPORTED: gpu-intel-dg2
1013

1114
// RUN: %{build} -o %t.out
1215
// RUN: %{run} %t.out
1316

14-
// This tests support of row major layout for matrix B which does automatic VNNI
15-
// transform. This is currently only available on AMX
16-
17+
// Sub-group size 32 support for this test is not currently available in IGC
1718
// XFAIL: gpu
1819

1920
#include "../common.hpp"
2021

2122
using namespace sycl;
2223
using namespace sycl::ext::oneapi::experimental::matrix;
2324

24-
constexpr size_t SG_SZ = 32;
25-
constexpr size_t TN = 16;
25+
#define SG_SZ 32
2626

27-
#include "../joint_matrix_bfloat16_rowmajorA_rowmajorB_impl.hpp"
27+
#include "../joint_matrix_rowmajorA_rowmajorB_impl.hpp"

sycl/test-e2e/Matrix/joint_matrix_bfloat16_rowmajorA_rowmajorB_impl.hpp

Lines changed: 0 additions & 94 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
//==--joint_matrix_bfloat16_rowmajorA_rowmajorB.cpp - DPC++ joint_matrix---==//
1+
//==-------joint_matrix_rowmajorA_rowmajorB.cpp - DPC++ joint_matrix-------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
// REQUIRES: matrix
8+
// REQUIRES: aspect-ext_intel_matrix
9+
// VNNI transform is not supported yet by IGC on DG2
10+
// UNSUPPORTED: gpu-intel-dg2
911

1012
// RUN: %{build} -o %t.out
1113
// RUN: %{run} %t.out
@@ -18,7 +20,4 @@
1820
using namespace sycl;
1921
using namespace sycl::ext::oneapi::experimental::matrix;
2022

21-
#define SG_SZ 16
22-
constexpr size_t TN = 16;
23-
24-
#include "joint_matrix_bfloat16_rowmajorA_rowmajorB_impl.hpp"
23+
#include "joint_matrix_rowmajorA_rowmajorB_impl.hpp"

0 commit comments

Comments
 (0)