|
1 |
| -// REQUIRES: opencl |
| 1 | +// See https://github.com/intel/llvm/issues/2922 for more info |
| 2 | +// UNSUPPORTED: cuda |
2 | 3 |
|
3 | 4 | // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
|
4 |
| -// RUN: %RUN_ON_HOST %t.out |
5 | 5 | // RUN: %CPU_RUN_PLACEHOLDER %t.out
|
6 | 6 | // RUN: %GPU_RUN_PLACEHOLDER %t.out
|
7 |
| -// RUN: %ACC_RUN_PLACEHOLDER %t.out |
8 | 7 |
|
9 | 8 | //==------------- info.cpp - SYCL sub_group parameters test ----*- C++ -*---==//
|
10 | 9 | //
|
@@ -36,24 +35,26 @@ int main() {
|
36 | 35 | try {
|
37 | 36 | size_t max_wg_size = Device.get_info<info::device::max_work_group_size>();
|
38 | 37 | program Prog(Queue.get_context());
|
39 |
| - /* TODO: replace with pure SYCL code when fixed problem with consumption |
40 |
| - * kernels defined using program objects on GPU device |
41 | 38 | Prog.build_with_kernel_type<kernel_sg>();
|
42 | 39 | kernel Kernel = Prog.get_kernel<kernel_sg>();
|
| 40 | + range<2> GlobalRange{50, 40}; |
| 41 | + |
| 42 | + buffer<double, 2> ABuf{GlobalRange}, BBuf{GlobalRange}, CBuf{GlobalRange}; |
43 | 43 |
|
44 | 44 | Queue.submit([&](cl::sycl::handler &cgh) {
|
| 45 | + auto A = ABuf.get_access<access::mode::read_write>(cgh); |
| 46 | + auto B = BBuf.get_access<access::mode::read>(cgh); |
| 47 | + auto C = CBuf.get_access<access::mode::read>(cgh); |
45 | 48 | cgh.parallel_for<kernel_sg>(
|
46 |
| - nd_range<2>(range<2>(50, 40), range<2>(10, 20)), Kernel, |
47 |
| - [=](nd_item<2> index) {}); |
48 |
| - });*/ |
49 |
| - Prog.build_with_source("kernel void " |
50 |
| - "kernel_sg(global double* a, global double* b, " |
51 |
| - "global double* c) {*a=*b+*c; }\n"); |
52 |
| - kernel Kernel = Prog.get_kernel("kernel_sg"); |
| 49 | + nd_range<2>(GlobalRange, range<2>(10, 20)), [=](nd_item<2> index) { |
| 50 | + const id<2> GlobalID = index.get_global_id(); |
| 51 | + A[GlobalID] = B[GlobalID] * C[GlobalID]; |
| 52 | + }); |
| 53 | + }); |
53 | 54 | uint32_t Res = 0;
|
54 | 55 |
|
55 |
| - /* sub_group_sizes can be quared only of cl_intel_required_subgroup_size |
56 |
| - * extention is supported by device*/ |
| 56 | + /* sub_group_sizes can be queried only if cl_intel_required_subgroup_size |
| 57 | + * extension is supported by device*/ |
57 | 58 | if (Device.has_extension("cl_intel_required_subgroup_size")) {
|
58 | 59 | auto sg_sizes = Device.get_info<info::device::sub_group_sizes>();
|
59 | 60 | for (auto r : {range<3>(3, 4, 5), range<3>(1, 1, 1), range<3>(4, 2, 1),
|
|
0 commit comments