Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 5a6bbb7

Browse files
author
Pavel Chupin
authored
Merge branch 'intel' into raaiq
2 parents 458d034 + 635fc6c commit 5a6bbb7

File tree

532 files changed

+2424
-2521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+2424
-2521
lines changed

SYCL/AOT/Inputs/aot.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,37 @@
1111
#include <array>
1212
#include <iostream>
1313

14-
constexpr cl::sycl::access::mode sycl_read = cl::sycl::access::mode::read;
15-
constexpr cl::sycl::access::mode sycl_write = cl::sycl::access::mode::write;
14+
constexpr sycl::access::mode sycl_read = sycl::access::mode::read;
15+
constexpr sycl::access::mode sycl_write = sycl::access::mode::write;
1616

1717
template <typename T> class SimpleVadd;
1818

1919
template <typename T, size_t N>
2020
void simple_vadd(const std::array<T, N> &VA, const std::array<T, N> &VB,
2121
std::array<T, N> &VC) {
22-
cl::sycl::queue deviceQueue([](cl::sycl::exception_list ExceptionList) {
22+
sycl::queue deviceQueue([](sycl::exception_list ExceptionList) {
2323
for (std::exception_ptr ExceptionPtr : ExceptionList) {
2424
try {
2525
std::rethrow_exception(ExceptionPtr);
26-
} catch (cl::sycl::exception &E) {
26+
} catch (sycl::exception &E) {
2727
std::cerr << E.what();
2828
} catch (...) {
2929
std::cerr << "Unknown async exception was caught." << std::endl;
3030
}
3131
}
3232
});
3333

34-
cl::sycl::range<1> numOfItems{N};
35-
cl::sycl::buffer<T, 1> bufferA(VA.data(), numOfItems);
36-
cl::sycl::buffer<T, 1> bufferB(VB.data(), numOfItems);
37-
cl::sycl::buffer<T, 1> bufferC(VC.data(), numOfItems);
34+
sycl::range<1> numOfItems{N};
35+
sycl::buffer<T, 1> bufferA(VA.data(), numOfItems);
36+
sycl::buffer<T, 1> bufferB(VB.data(), numOfItems);
37+
sycl::buffer<T, 1> bufferC(VC.data(), numOfItems);
3838

39-
deviceQueue.submit([&](cl::sycl::handler &cgh) {
39+
deviceQueue.submit([&](sycl::handler &cgh) {
4040
auto accessorA = bufferA.template get_access<sycl_read>(cgh);
4141
auto accessorB = bufferB.template get_access<sycl_read>(cgh);
4242
auto accessorC = bufferC.template get_access<sycl_write>(cgh);
4343

44-
cgh.parallel_for<class SimpleVadd<T>>(numOfItems,
45-
[=](cl::sycl::id<1> wiID) {
44+
cgh.parallel_for<class SimpleVadd<T>>(numOfItems, [=](sycl::id<1> wiID) {
4645
accessorC[wiID] = accessorA[wiID] + accessorB[wiID];
4746
});
4847
});
@@ -52,10 +51,10 @@ void simple_vadd(const std::array<T, N> &VA, const std::array<T, N> &VB,
5251

5352
int main() {
5453
const size_t array_size = 4;
55-
std::array<cl::sycl::cl_int, array_size> A = {{1, 2, 3, 4}},
56-
B = {{1, 2, 3, 4}}, C;
57-
std::array<cl::sycl::cl_float, array_size> D = {{1.f, 2.f, 3.f, 4.f}},
58-
E = {{1.f, 2.f, 3.f, 4.f}}, F;
54+
std::array<sycl::cl_int, array_size> A = {{1, 2, 3, 4}}, B = {{1, 2, 3, 4}},
55+
C;
56+
std::array<sycl::cl_float, array_size> D = {{1.f, 2.f, 3.f, 4.f}},
57+
E = {{1.f, 2.f, 3.f, 4.f}}, F;
5958
simple_vadd(A, B, C);
6059
simple_vadd(D, E, F);
6160
for (unsigned int i = 0; i < array_size; i++) {

SYCL/Assert/Inputs/kernels_in_file2.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include <cassert>
1010

11-
using namespace cl::sycl;
12-
using namespace cl::sycl::access;
11+
using namespace sycl;
12+
using namespace sycl::access;
1313

1414
int calculus(int X) {
1515
assert(X && "this message from calculus");
@@ -21,25 +21,25 @@ void check_nil(int value) { assert(value && "this message from file2"); }
2121
static constexpr size_t BUFFER_SIZE = 4;
2222

2323
void enqueueKernel_1_fromFile2(queue *Q) {
24-
cl::sycl::range<1> numOfItems{BUFFER_SIZE};
25-
cl::sycl::buffer<int, 1> Buf(numOfItems);
24+
sycl::range<1> numOfItems{BUFFER_SIZE};
25+
sycl::buffer<int, 1> Buf(numOfItems);
2626

2727
Q->submit([&](handler &CGH) {
2828
auto Acc = Buf.template get_access<mode::read_write>(CGH);
2929

3030
CGH.parallel_for<class kernel1_from_separate_file>(
31-
numOfItems, [=](cl::sycl::id<1> wiID) { check_nil(Acc[wiID]); });
31+
numOfItems, [=](sycl::id<1> wiID) { check_nil(Acc[wiID]); });
3232
});
3333
}
3434

3535
void enqueueKernel_2_fromFile2(queue *Q) {
36-
cl::sycl::range<1> numOfItems{BUFFER_SIZE};
37-
cl::sycl::buffer<int, 1> Buf(numOfItems);
36+
sycl::range<1> numOfItems{BUFFER_SIZE};
37+
sycl::buffer<int, 1> Buf(numOfItems);
3838

3939
Q->submit([&](handler &CGH) {
4040
auto Acc = Buf.template get_access<mode::read_write>(CGH);
4141

4242
CGH.parallel_for<class kernel2_from_separate_file>(
43-
numOfItems, [=](cl::sycl::id<1> wiID) { check_nil(Acc[wiID]); });
43+
numOfItems, [=](sycl::id<1> wiID) { check_nil(Acc[wiID]); });
4444
});
4545
}

SYCL/Assert/assert_in_kernels.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1212
//
1313
// CHECK-NOT: One shouldn't see this message
14-
// CHECK: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
14+
// CHECK: {{.*}}assert_in_kernels.hpp:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1515
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
1616
// CHECK-NOT: test aborts earlier, one shouldn't see this message
1717
// CHECK-NOT: The test ended.
1818
//
19-
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
19+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
2020
// CHECK-ACC: The test ended.
2121

2222
#include "assert_in_kernels.hpp"

SYCL/Assert/assert_in_kernels.hpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include <iostream>
33
#include <sycl/sycl.hpp>
44

5-
using namespace cl::sycl;
6-
using namespace cl::sycl::access;
5+
using namespace sycl;
6+
using namespace sycl::access;
77

88
void kernelFunc1(int *Buf, int wiID) {
99
Buf[wiID] = 9;
@@ -15,8 +15,7 @@ void assertTest1(queue &Q, buffer<int, 1> &Buf) {
1515
auto Acc = Buf.template get_access<mode::read_write>(CGH);
1616

1717
CGH.parallel_for<class Kernel_1>(
18-
Buf.get_range(),
19-
[=](cl::sycl::id<1> wiID) { kernelFunc1(&Acc[0], wiID); });
18+
Buf.get_range(), [=](sycl::id<1> wiID) { kernelFunc1(&Acc[0], wiID); });
2019
});
2120
}
2221

@@ -31,8 +30,7 @@ void assertTest2(queue &Q, buffer<int, 1> &Buf) {
3130
auto Acc = Buf.template get_access<mode::read_write>(CGH);
3231

3332
CGH.parallel_for<class Kernel_2>(
34-
Buf.get_range(),
35-
[=](cl::sycl::id<1> wiID) { kernelFunc2(&Acc[0], wiID); });
33+
Buf.get_range(), [=](sycl::id<1> wiID) { kernelFunc2(&Acc[0], wiID); });
3634
});
3735
}
3836

@@ -47,15 +45,14 @@ void assertTest3(queue &Q, buffer<int, 1> &Buf) {
4745
auto Acc = Buf.template get_access<mode::read_write>(CGH);
4846

4947
CGH.parallel_for<class Kernel_3>(
50-
Buf.get_range(),
51-
[=](cl::sycl::id<1> wiID) { kernelFunc3(&Acc[0], wiID); });
48+
Buf.get_range(), [=](sycl::id<1> wiID) { kernelFunc3(&Acc[0], wiID); });
5249
});
5350
}
5451

5552
int main(int Argc, const char *Argv[]) {
5653
std::array<int, 4> Vec = {1, 2, 3, 4};
57-
cl::sycl::range<1> numOfItems{Vec.size()};
58-
cl::sycl::buffer<int, 1> Buf(Vec.data(), numOfItems);
54+
sycl::range<1> numOfItems{Vec.size()};
55+
sycl::buffer<int, 1> Buf(Vec.data(), numOfItems);
5956

6057
queue Q;
6158
assertTest1(Q, Buf);

SYCL/Assert/assert_in_kernels_win.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// CHECK-NOT: One shouldn't see this message
1313
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1414
// while for some insane reason.
15-
// CHECK: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
15+
// CHECK: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1616
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
1717
// CHECK-NOT: test aborts earlier, one shouldn't see this message
1818
// CHECK-NOT: The test ended.
1919
//
20-
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
20+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
2121
// CHECK-ACC: The test ended.
2222

2323
#include "assert_in_kernels.hpp"

SYCL/Assert/assert_in_multiple_tus.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#include <cassert>
1212

13-
using namespace cl::sycl;
14-
using namespace cl::sycl::access;
13+
using namespace sycl;
14+
using namespace sycl::access;
1515

1616
static constexpr size_t BUFFER_SIZE = 16;
1717

@@ -22,15 +22,15 @@ int checkFunction() {
2222
}
2323

2424
void enqueueKernel_1_fromFile1(queue *Q) {
25-
cl::sycl::range<1> numOfItems{BUFFER_SIZE};
26-
cl::sycl::buffer<int, 1> Buf(numOfItems);
25+
sycl::range<1> numOfItems{BUFFER_SIZE};
26+
sycl::buffer<int, 1> Buf(numOfItems);
2727

2828
Q->submit([&](handler &CGH) {
2929
auto Acc = Buf.template get_access<mode::read_write>(CGH);
3030

3131
CGH.parallel_for<class Kernel_1>(
32-
cl::sycl::nd_range(Buf.get_range(), cl::sycl::range<1>(4)),
33-
[=](cl::sycl::id<1> wiID) {
32+
sycl::nd_range(Buf.get_range(), sycl::range<1>(4)),
33+
[=](sycl::id<1> wiID) {
3434
int X = 0;
3535
if (wiID == 5)
3636
X = checkFunction();

SYCL/Assert/assert_in_one_kernel.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include <iostream>
33
#include <sycl/sycl.hpp>
44

5-
using namespace cl::sycl;
6-
using namespace cl::sycl::access;
5+
using namespace sycl;
6+
using namespace sycl::access;
77

88
void kernelFunc(int *Buf, int wiID) {
99
Buf[wiID] = 0;
@@ -12,8 +12,8 @@ void kernelFunc(int *Buf, int wiID) {
1212

1313
void assertTest() {
1414
std::array<int, 4> Vec = {1, 2, 3, 4};
15-
cl::sycl::range<1> numOfItems{Vec.size()};
16-
cl::sycl::buffer<int, 1> Buf(Vec.data(), numOfItems);
15+
sycl::range<1> numOfItems{Vec.size()};
16+
sycl::buffer<int, 1> Buf(Vec.data(), numOfItems);
1717

1818
queue Q;
1919
Q.submit([&](handler &CGH) {

SYCL/Assert/assert_in_simultaneous_kernels.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include <sycl/sycl.hpp>
55
#include <thread>
66

7-
using namespace cl::sycl;
8-
using namespace cl::sycl::access;
7+
using namespace sycl;
8+
using namespace sycl::access;
99

1010
static constexpr size_t NUM_THREADS = 4;
1111
static constexpr size_t RANGE_SIZE = 1024;

SYCL/Assert/assert_in_simultaneously_multiple_tus.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@
3838

3939
#include <cassert>
4040

41-
using namespace cl::sycl;
42-
using namespace cl::sycl::access;
41+
using namespace sycl;
42+
using namespace sycl::access;
4343

4444
static constexpr size_t NUM_THREADS = 4;
4545
static constexpr size_t BUFFER_SIZE = 10;
4646

4747
template <class kernel_name> void enqueueKernel(queue *Q) {
48-
cl::sycl::range<1> numOfItems{BUFFER_SIZE};
49-
cl::sycl::buffer<int, 1> Buf(numOfItems);
48+
sycl::range<1> numOfItems{BUFFER_SIZE};
49+
sycl::buffer<int, 1> Buf(numOfItems);
5050

5151
Q->submit([&](handler &CGH) {
5252
auto Acc = Buf.template get_access<mode::read_write>(CGH);
5353

54-
CGH.parallel_for<kernel_name>(numOfItems, [=](cl::sycl::id<1> wiID) {
54+
CGH.parallel_for<kernel_name>(numOfItems, [=](sycl::id<1> wiID) {
5555
Acc[wiID] = 0;
5656
if (wiID == 5)
5757
assert(false && "this message from file1");

SYCL/BFloat16/bfloat16_type.hpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <cmath>
66

7-
using namespace cl::sycl;
7+
using namespace sycl;
88

99
constexpr size_t N = 100;
1010

@@ -21,7 +21,7 @@ void verify_conv_implicit(queue &q, buffer<float, 1> &a, range<1> &r,
2121
q.submit([&](handler &cgh) {
2222
auto A = a.get_access<access::mode::read_write>(cgh);
2323
cgh.parallel_for<class calc_conv>(r, [=](id<1> index) {
24-
cl::sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
24+
sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
2525
A[index] = AVal;
2626
});
2727
});
@@ -35,8 +35,8 @@ void verify_conv_explicit(queue &q, buffer<float, 1> &a, range<1> &r,
3535
auto A = a.get_access<access::mode::read_write>(cgh);
3636
cgh.parallel_for<class calc_conv_impl>(r, [=](id<1> index) {
3737
uint16_t AVal =
38-
cl::sycl::ext::oneapi::experimental::bfloat16::from_float(A[index]);
39-
A[index] = cl::sycl::ext::oneapi::experimental::bfloat16::to_float(AVal);
38+
sycl::ext::oneapi::experimental::bfloat16::from_float(A[index]);
39+
A[index] = sycl::ext::oneapi::experimental::bfloat16::to_float(AVal);
4040
});
4141
});
4242

@@ -52,9 +52,9 @@ void verify_add(queue &q, buffer<float, 1> &a, buffer<float, 1> &b, range<1> &r,
5252
auto B = b.get_access<access::mode::read>(cgh);
5353
auto C = c.get_access<access::mode::write>(cgh);
5454
cgh.parallel_for<class calc_add_expl>(r, [=](id<1> index) {
55-
cl::sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
56-
cl::sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
57-
cl::sycl::ext::oneapi::experimental::bfloat16 CVal = AVal + BVal;
55+
sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
56+
sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
57+
sycl::ext::oneapi::experimental::bfloat16 CVal = AVal + BVal;
5858
C[index] = CVal;
5959
});
6060
});
@@ -71,9 +71,9 @@ void verify_sub(queue &q, buffer<float, 1> &a, buffer<float, 1> &b, range<1> &r,
7171
auto B = b.get_access<access::mode::read>(cgh);
7272
auto C = c.get_access<access::mode::write>(cgh);
7373
cgh.parallel_for<class calc_sub>(r, [=](id<1> index) {
74-
cl::sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
75-
cl::sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
76-
cl::sycl::ext::oneapi::experimental::bfloat16 CVal = AVal - BVal;
74+
sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
75+
sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
76+
sycl::ext::oneapi::experimental::bfloat16 CVal = AVal - BVal;
7777
C[index] = CVal;
7878
});
7979
});
@@ -88,8 +88,8 @@ void verify_minus(queue &q, buffer<float, 1> &a, range<1> &r, const float ref) {
8888
auto A = a.get_access<access::mode::read>(cgh);
8989
auto C = c.get_access<access::mode::write>(cgh);
9090
cgh.parallel_for<class calc_minus>(r, [=](id<1> index) {
91-
cl::sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
92-
cl::sycl::ext::oneapi::experimental::bfloat16 CVal = -AVal;
91+
sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
92+
sycl::ext::oneapi::experimental::bfloat16 CVal = -AVal;
9393
C[index] = CVal;
9494
});
9595
});
@@ -106,9 +106,9 @@ void verify_mul(queue &q, buffer<float, 1> &a, buffer<float, 1> &b, range<1> &r,
106106
auto B = b.get_access<access::mode::read>(cgh);
107107
auto C = c.get_access<access::mode::write>(cgh);
108108
cgh.parallel_for<class calc_mul>(r, [=](id<1> index) {
109-
cl::sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
110-
cl::sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
111-
cl::sycl::ext::oneapi::experimental::bfloat16 CVal = AVal * BVal;
109+
sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
110+
sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
111+
sycl::ext::oneapi::experimental::bfloat16 CVal = AVal * BVal;
112112
C[index] = CVal;
113113
});
114114
});
@@ -125,9 +125,9 @@ void verify_div(queue &q, buffer<float, 1> &a, buffer<float, 1> &b, range<1> &r,
125125
auto B = b.get_access<access::mode::read>(cgh);
126126
auto C = c.get_access<access::mode::write>(cgh);
127127
cgh.parallel_for<class calc_div>(r, [=](id<1> index) {
128-
cl::sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
129-
cl::sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
130-
cl::sycl::ext::oneapi::experimental::bfloat16 CVal = AVal / BVal;
128+
sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
129+
sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
130+
sycl::ext::oneapi::experimental::bfloat16 CVal = AVal / BVal;
131131
C[index] = CVal;
132132
});
133133
});
@@ -144,12 +144,12 @@ void verify_logic(queue &q, buffer<float, 1> &a, buffer<float, 1> &b,
144144
auto B = b.get_access<access::mode::read>(cgh);
145145
auto C = c.get_access<access::mode::write>(cgh);
146146
cgh.parallel_for<class logic>(r, [=](id<1> index) {
147-
cl::sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
148-
cl::sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
147+
sycl::ext::oneapi::experimental::bfloat16 AVal{A[index]};
148+
sycl::ext::oneapi::experimental::bfloat16 BVal{B[index]};
149149
if (AVal) {
150150
if (AVal > BVal || AVal >= BVal || AVal < BVal || AVal <= BVal ||
151151
!BVal) {
152-
cl::sycl::ext::oneapi::experimental::bfloat16 CVal =
152+
sycl::ext::oneapi::experimental::bfloat16 CVal =
153153
AVal != BVal ? AVal : BVal;
154154
CVal--;
155155
CVal++;

SYCL/Basic/access_to_subset.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
//===----------------------------------------------------------------------===//
1414
#include <iostream>
1515
#include <sycl/sycl.hpp>
16-
using namespace cl::sycl;
16+
17+
using namespace sycl;
1718
using acc_w = accessor<int, 2, access::mode::write, access::target::device>;
1819

1920
int main() {

0 commit comments

Comments
 (0)