This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,9 @@ using namespace cl;
20
20
21
21
static void replaceSpecialCharacters (std::string &Str) {
22
22
// Replace common special symbols with '.' which matches to any character
23
- std::replace_if (Str.begin (), Str.end (),
24
- [](const char Sym) { return ' (' == Sym || ' )' == Sym; }, ' .' );
23
+ std::replace_if (
24
+ Str.begin (), Str.end (),
25
+ [](const char Sym) { return ' (' == Sym || ' )' == Sym; }, ' .' );
25
26
}
26
27
27
28
int main () {
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ // UNSUPPORTED: cuda
2
+ // CUDA does not support SPIR-V.
3
+
4
+ // RUN: %clangxx -fsycl-device-only -fno-sycl-use-bitcode -Xclang -fsycl-int-header=%t.h -c %s -o %t.spv -I %sycl_include -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict
5
+ // RUN: %clangxx -include %t.h %s -o %t.out -lsycl -I %sycl_include -Xclang -verify-ignore-unexpected=note,warning
6
+ // RUN: env SYCL_BE=%sycl_be SYCL_USE_KERNEL_SPV=%t.spv %t.out | FileCheck %s
7
+ // CHECK: Passed
8
+
9
+ #include < CL/sycl.hpp>
10
+ #include < iostream>
11
+
12
+ using namespace cl ::sycl;
13
+
14
+ int main (int argc, char **argv) {
15
+ int data = 5 ;
16
+
17
+ try {
18
+ queue myQueue;
19
+ buffer<int , 1 > buf (&data, range<1 >(1 ));
20
+
21
+ event e = myQueue.submit ([&](handler &cgh) {
22
+ auto ptr = buf.get_access <access::mode::read_write>(cgh);
23
+
24
+ cgh.single_task <class my_kernel >([=]() { ptr[0 ]++; });
25
+ });
26
+ e.wait_and_throw ();
27
+
28
+ } catch (cl::sycl::exception const &e) {
29
+ std::cerr << " SYCL exception caught:\n " ;
30
+ std::cerr << e.what () << " \n " ;
31
+ return 2 ;
32
+ } catch (...) {
33
+ std::cerr << " unknown exception caught\n " ;
34
+ return 1 ;
35
+ }
36
+
37
+ if (data == 6 ) {
38
+ std::cout << " Passed\n " ;
39
+ return 0 ;
40
+ } else {
41
+ std::cout << " Failed: " << data << " != 6(gold)\n " ;
42
+ return 1 ;
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments