Skip to content

Commit 2d66de2

Browse files
committed
Add E2E for Windows
1 parent b998d30 commit 2d66de2

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// RUN: %clang_cl -fsycl -fsycl-host-compiler=cl -DDEFINE_CHECK -fsycl-host-compiler-options="-DDEFINE_CHECK" /Fe%t1.exe %s
2+
// RUN: %RUN_ON_HOST %t1.exe
3+
// REQUIRES: system-windows
4+
//
5+
//==------- fsycl-host-compiler-win.cpp - external host compiler test ------==//
6+
//
7+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
8+
// See https://llvm.org/LICENSE.txt for license information.
9+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10+
//
11+
//===----------------------------------------------------------------------===//
12+
//
13+
// Uses -fsycl-host-compiler=<compiler> on a simple test, requires 'cl'
14+
15+
#include <CL/sycl.hpp>
16+
17+
#ifndef DEFINE_CHECK
18+
#error predefined macro not set
19+
#endif // DEFINE_CHECK
20+
21+
using namespace cl::sycl;
22+
23+
int main() {
24+
int data[] = {0, 0, 0};
25+
26+
{
27+
buffer<int, 1> b(data, range<1>(3), {property::buffer::use_host_ptr()});
28+
queue q;
29+
q.submit([&](handler &cgh) {
30+
auto B = b.get_access<access::mode::write>(cgh);
31+
cgh.parallel_for<class test>(range<1>(3), [=](id<1> idx) {
32+
B[idx] = 1;
33+
});
34+
});
35+
}
36+
37+
bool isSuccess = true;
38+
39+
for (int i = 0; i < 3; i++)
40+
if (data[i] != 1) isSuccess = false;
41+
42+
if (!isSuccess)
43+
return -1;
44+
45+
return 0;
46+
}

0 commit comments

Comments
 (0)