File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
test/basic_tests/accessor Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ enum class target {
21
21
image = 2017 ,
22
22
host_buffer = 2018 ,
23
23
host_image = 2019 ,
24
- image_array = 2020
24
+ image_array = 2020 ,
25
+ device = global_buffer,
25
26
};
26
27
27
28
enum class mode {
Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2
+
3
+ // This short test simply confirms that target::device
4
+ // is supported correctly.
5
+ // TODO: delete this test and test the functionality
6
+ // over in llvm-test-suite along with the other changes
7
+ // needed to support the SYCL 2020 target updates.
8
+
9
+ #include < CL/sycl.hpp>
10
+
11
+ int main () {
12
+ sycl::queue testQueue;
13
+ sycl::range<1 > ndRng (1 );
14
+ int kernelResult;
15
+ {
16
+ sycl::buffer<int , 1 > buffer (&kernelResult, ndRng);
17
+
18
+ testQueue.submit ([&](sycl::handler &cgh) {
19
+ auto ptr = buffer.get_access <sycl::access_mode::read_write,
20
+ sycl::target::device>(cgh);
21
+ cgh.single_task <class kernel >([=]() { ptr[0 ] = 5 ; });
22
+ });
23
+ } // ~buffer
24
+
25
+ // std::cout << "kernelResult should be 5: " << kernelResult << std::endl;
26
+ assert (kernelResult == 5 );
27
+
28
+ return 0 ;
29
+ }
You can’t perform that action at this time.
0 commit comments