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

Commit ba6a9fd

Browse files
author
aidan.belton
committed
Merge branch 'intel' of https://github.com/AidanBeltonS/llvm-test-suite into local_accessor
2 parents a12a084 + c4d6c14 commit ba6a9fd

File tree

733 files changed

+6196
-3985
lines changed

Some content is hidden

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

733 files changed

+6196
-3985
lines changed

SYCL/AOT/Inputs/aot.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,42 @@
66
//
77
//===---------------------------------------------------------------------===//
88

9-
#include <CL/sycl.hpp>
9+
#include <sycl/sycl.hpp>
1010

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/Inputs/kernels_in_file2.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <CL/sycl.hpp>
1+
#include <sycl/sycl.hpp>
22

33
SYCL_EXTERNAL int calculus(int X);
44

SYCL/Assert/assert_in_kernels.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
42
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
53
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
64
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -11,12 +9,12 @@
119
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1210
//
1311
// CHECK-NOT: One shouldn't see this message
14-
// CHECK: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): global id: [{{[0,2]}},0,0], local id: [0,0,0]
12+
// CHECK: {{.*}}assert_in_kernels.hpp:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1513
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
1614
// CHECK-NOT: test aborts earlier, one shouldn't see this message
1715
// CHECK-NOT: The test ended.
1816
//
19-
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): global id: [{{[0,2]}},0,0], local id: [0,0,0]
17+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:25: void kernelFunc2(int *, int): {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
2018
// CHECK-ACC: The test ended.
2119

2220
#include "assert_in_kernels.hpp"

SYCL/Assert/assert_in_kernels.hpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include <CL/sycl.hpp>
21
#include <cassert>
32
#include <iostream>
3+
#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_ndebug.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
2-
// UNSUPPORTED: cuda || hip
31
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -DNDEBUG %S/assert_in_kernels.cpp -o %t.out
42
// RUN: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER
53
// RUN: %GPU_RUN_PLACEHOLDER %t.out %GPU_CHECK_PLACEHOLDER

SYCL/Assert/assert_in_kernels_win.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// REQUIRES: windows
2-
// UNSUPPORTED: cuda || hip
32
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
43
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
54
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -12,12 +11,12 @@
1211
// CHECK-NOT: One shouldn't see this message
1312
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
1413
// while for some insane reason.
15-
// CHECK: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: global id: [{{[0,2]}},0,0], local id: [0,0,0]
14+
// CHECK: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
1615
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
1716
// CHECK-NOT: test aborts earlier, one shouldn't see this message
1817
// CHECK-NOT: The test ended.
1918
//
20-
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: global id: [{{[0,2]}},0,0], local id: [0,0,0]
19+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:25: {{<unknown func>|(null)}}: {{.*}} [{{[0,2]}},0,0], {{.*}} [0,0,0]
2120
// CHECK-ACC: The test ended.
2221

2322
#include "assert_in_kernels.hpp"

SYCL/Assert/assert_in_multiple_tus.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
42
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -I %S/Inputs %s %S/Inputs/kernels_in_file2.cpp -o %t.out
53
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
64
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -10,7 +8,9 @@
108
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt
119
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1210
//
13-
// CHECK: {{.*}}kernels_in_file2.cpp:15: int calculus(int): global id: [5,0,0], local id: [1,0,0]
11+
// CUDA uses block/thread vs global/local id for SYCL, also it shows the
12+
// position of a thread within the block, not the absolute ID.
13+
// CHECK: {{.*}}kernels_in_file2.cpp:15: int calculus(int): {{global id: \[5|block: \[1}},0,0], {{local id|thread}}: [1,0,0]
1414
// CHECK-SAME: Assertion `X && "this message from calculus"` failed.
1515
// CHECK-NOT: this message from file2
1616
// CHECK-NOT: The test ended.

SYCL/Assert/assert_in_multiple_tus.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "Inputs/kernels_in_file2.hpp"
2-
#include <CL/sycl.hpp>
32
#include <iostream>
3+
#include <sycl/sycl.hpp>
44

55
#ifdef DEFINE_NDEBUG_INFILE1
66
#define NDEBUG
@@ -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();
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// REQUIRES: linux
2-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3-
// UNSUPPORTED: cuda || hip
42
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%sycl_triple -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out
53
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
64
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
@@ -11,10 +9,12 @@
119
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
1210
//
1311
// CHECK-NOT: this message from calculus
14-
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): global id: [5,0,0],
15-
// CHECK-SAME: local id: [1,0,0] Assertion `X && "Nil in result"` failed.
12+
// CUDA uses block/thread vs global/local id for SYCL, also it shows the
13+
// position of a thread within the block, not the absolute ID.
14+
// CHECK: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{global id: \[5|block: \[1}},0,0],
15+
// CHECK-SAME: {{.*}} [1,0,0] Assertion `X && "Nil in result"` failed.
1616
// CHECK-NOT: this message from file2
1717
// CHECK-NOT: The test ended.
1818
//
19-
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): global id: [5,0,0],
19+
// CHECK-ACC-NOT: {{.*}}assert_in_multiple_tus.hpp:20: int checkFunction(): {{.*}}
2020
// CHECK-ACC: The test ended.

0 commit comments

Comments
 (0)