From e074629daec8977d399f35a2db2a20b14cc4c4fa Mon Sep 17 00:00:00 2001 From: vladimirlaz Date: Wed, 21 Oct 2020 08:13:29 +0300 Subject: [PATCH 1/2] [SYCL] remove tests added to llvm-test-suite (#2654) Tests which do no support host execution are removed. Other tests are limited to compilation and execution on host device. --- .../context-with-multiple-devices.cpp | 45 ---- .../function-pointers/fp-as-kernel-arg.cpp | 7 - .../pass-fp-through-buffer.cpp | 7 - sycl/test/functor/functor_inheritance.cpp | 3 - sycl/test/functor/kernel_functor.cpp | 2 - .../test/kernel-and-program/basic-program.cpp | 93 -------- sycl/test/kernel-and-program/build-log.cpp | 51 ----- .../kernel-and-program/cache-build-result.cpp | 47 ---- sycl/test/kernel-and-program/get-options.cpp | 45 ---- .../kernel-and-program-interop.cpp | 205 ------------------ .../kernel-and-program/kernel-and-program.cpp | 137 ------------ sycl/test/kernel_from_file/hw.cpp | 51 ----- .../array-kernel-param-nested-run.cpp | 3 - .../array-kernel-param-run.cpp | 3 - .../non-standard-layout.cpp | 3 - .../struct_kernel_param.cpp | 4 - .../union_kernel_param.cpp | 3 - sycl/test/multi_ptr/multi_ptr.cpp | 6 - 18 files changed, 715 deletions(-) delete mode 100644 sycl/test/context-with-multiple-devices/context-with-multiple-devices.cpp delete mode 100644 sycl/test/kernel-and-program/basic-program.cpp delete mode 100644 sycl/test/kernel-and-program/build-log.cpp delete mode 100644 sycl/test/kernel-and-program/cache-build-result.cpp delete mode 100644 sycl/test/kernel-and-program/get-options.cpp delete mode 100644 sycl/test/kernel-and-program/kernel-and-program-interop.cpp delete mode 100644 sycl/test/kernel-and-program/kernel-and-program.cpp delete mode 100644 sycl/test/kernel_from_file/hw.cpp rename sycl/test/{array_param => kernel_param}/array-kernel-param-nested-run.cpp (97%) rename sycl/test/{array_param => kernel_param}/array-kernel-param-run.cpp (98%) rename sycl/test/{struct_param => kernel_param}/non-standard-layout.cpp (87%) rename sycl/test/{struct_param => kernel_param}/struct_kernel_param.cpp (96%) rename sycl/test/{union_param => kernel_param}/union_kernel_param.cpp (88%) diff --git a/sycl/test/context-with-multiple-devices/context-with-multiple-devices.cpp b/sycl/test/context-with-multiple-devices/context-with-multiple-devices.cpp deleted file mode 100644 index 8409d77cdf3b..000000000000 --- a/sycl/test/context-with-multiple-devices/context-with-multiple-devices.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// REQUIRES: cpu, accelerator, aoc - -// UNSUPPORTED: cuda, level_zero - -// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t1.out -// RUN: %CPU_RUN_PLACEHOLDER CL_CONFIG_CPU_EMULATE_DEVICES=2 %t1.out -// RUN: %CPU_RUN_PLACEHOLDER CL_CONFIG_CPU_EMULATE_DEVICES=4 %t1.out -// RUN: %clangxx -fsycl -fintelfpga -fsycl-unnamed-lambda %s -o %t2.out -// RUN: %ACC_RUN_PLACEHOLDER CL_CONFIG_CPU_EMULATE_DEVICES=2 %t2.out - -#include - -void exceptionHandler(sycl::exception_list exceptions) { - for (std::exception_ptr const &e : exceptions) { - try { - std::rethrow_exception(e); - } catch (sycl::exception const &e) { - std::cerr << "Caught asynchronous SYCL exception:\n" - << e.what() << std::endl; - } - } -} - -int main() { - auto DeviceList = sycl::device::get_devices(); - - // remove host device from the list - DeviceList.erase(std::remove_if(DeviceList.begin(), DeviceList.end(), - [](auto Device) { return Device.is_host(); }), - DeviceList.end()); - - sycl::context Context(DeviceList, &exceptionHandler); - - std::vector QueueList; - for (const auto &Device : Context.get_devices()) { - QueueList.emplace_back(Context, Device, &exceptionHandler); - } - - for (auto &Queue : QueueList) { - Queue.submit( - [&](sycl::handler &cgh) { cgh.parallel_for(100, [=](auto i) {}); }); - } - - return 0; -} diff --git a/sycl/test/function-pointers/fp-as-kernel-arg.cpp b/sycl/test/function-pointers/fp-as-kernel-arg.cpp index dfd8ba1ffb0e..522c4c05f651 100644 --- a/sycl/test/function-pointers/fp-as-kernel-arg.cpp +++ b/sycl/test/function-pointers/fp-as-kernel-arg.cpp @@ -1,12 +1,5 @@ -// UNSUPPORTED: windows -// UNSUPPORTED: cuda || level_zero -// CUDA does not support the function pointer as kernel argument extension. -// Hangs on level zero - // RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out // FIXME: This test should use runtime early exit once correct check for // corresponding extension is implemented diff --git a/sycl/test/function-pointers/pass-fp-through-buffer.cpp b/sycl/test/function-pointers/pass-fp-through-buffer.cpp index 65b0c7ec6d76..abb83e25dbd4 100644 --- a/sycl/test/function-pointers/pass-fp-through-buffer.cpp +++ b/sycl/test/function-pointers/pass-fp-through-buffer.cpp @@ -1,12 +1,5 @@ -// UNSUPPORTED: windows -// UNSUPPORTED: cuda || level_zero -// CUDA does not support the function pointer as kernel argument extension. -// Hangs on level zero - // RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out // FIXME: This test should use runtime early exit once correct check for // corresponding extension is implemented diff --git a/sycl/test/functor/functor_inheritance.cpp b/sycl/test/functor/functor_inheritance.cpp index 436e8ce74a7d..06cb3e9d8152 100644 --- a/sycl/test/functor/functor_inheritance.cpp +++ b/sycl/test/functor/functor_inheritance.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -o %t.out %s // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/functor/kernel_functor.cpp b/sycl/test/functor/kernel_functor.cpp index 9bed0b451ca2..bea05fcc4dcd 100644 --- a/sycl/test/functor/kernel_functor.cpp +++ b/sycl/test/functor/kernel_functor.cpp @@ -1,8 +1,6 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -o %t.out %s // RUN: cd %T // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out //==--- kernel_functor.cpp - Functors as SYCL kernel test ------------------==// // diff --git a/sycl/test/kernel-and-program/basic-program.cpp b/sycl/test/kernel-and-program/basic-program.cpp deleted file mode 100644 index 202f647ea37c..000000000000 --- a/sycl/test/kernel-and-program/basic-program.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// XFAIL: cuda -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out - -//==--- basic-program.cpp - Basic test of program and kernel APIs ----------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -#include - -int main() { - - // Test program and kernel APIs when building a kernel. - { - cl::sycl::queue q; - int data = 0; - { - cl::sycl::buffer buf(&data, cl::sycl::range<1>(1)); - cl::sycl::program prg(q.get_context()); - assert(prg.get_state() == cl::sycl::program_state::none); - prg.build_with_kernel_type(); - assert(prg.get_state() == cl::sycl::program_state::linked); - cl::sycl::vector_class> binaries = - prg.get_binaries(); - assert(prg.has_kernel()); - cl::sycl::kernel krn = prg.get_kernel(); - cl::sycl::string_class name = - krn.get_info(); - assert(prg.has_kernel(name)); - - q.submit([&](cl::sycl::handler &cgh) { - auto acc = buf.get_access(cgh); - cgh.single_task(krn, [=]() { acc[0] = acc[0] + 1; }); - }); - } - assert(data == 1); - } - - // Test program and kernel APIs when compiling / linking a kernel. - { - cl::sycl::queue q; - int data = 0; - { - cl::sycl::buffer buf(&data, cl::sycl::range<1>(1)); - cl::sycl::program prg(q.get_context()); - assert(prg.get_state() == cl::sycl::program_state::none); - prg.compile_with_kernel_type(); - assert(prg.get_state() == cl::sycl::program_state::compiled); - prg.link(); - assert(prg.get_state() == cl::sycl::program_state::linked); - cl::sycl::vector_class> binaries = - prg.get_binaries(); - assert(prg.has_kernel()); - cl::sycl::kernel krn = prg.get_kernel(); - cl::sycl::string_class name = - krn.get_info(); - assert(prg.has_kernel(name)); - - q.submit([&](cl::sycl::handler &cgh) { - auto acc = buf.get_access(cgh); - cgh.single_task(krn, - [=]() { acc[0] = acc[0] + 1; }); - }); - } - assert(data == 1); - } - - { - sycl::context context; - std::vector devices = context.get_devices(); - - sycl::program prg1(context, sycl::property_list{}); - sycl::program prg2( - context, devices, - sycl::property_list{sycl::property::buffer::use_host_ptr{}}); - if (!prg2.has_property()) { - std::cerr << "Line " << __LINE__ << ": Property was not found" - << std::endl; - return 1; - } - - sycl::property::buffer::use_host_ptr Prop = - prg2.get_property(); - } -} diff --git a/sycl/test/kernel-and-program/build-log.cpp b/sycl/test/kernel-and-program/build-log.cpp deleted file mode 100644 index cc3c3bedbe28..000000000000 --- a/sycl/test/kernel-and-program/build-log.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// XFAIL: cuda -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out - -//==--- build-log.cpp - Test log message from faild build ----------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===--------------------------------------------------------------===// - -#include - -SYCL_EXTERNAL -void symbol_that_does_not_exist(); - -void test() { - cl::sycl::queue Queue; - - // Submitting this kernel should result in a compile_program_error exception - // with a message indicating that "symbol_that_does_not_exist" is undefined. - auto Kernel = []() { -#ifdef __SYCL_DEVICE_ONLY__ - symbol_that_does_not_exist(); -#endif - }; - - std::string Msg; - int Result; - - try { - Queue.submit([&](cl::sycl::handler &CGH) { - CGH.single_task(Kernel); - }); - assert(false && "There must be compilation error"); - } catch (const cl::sycl::compile_program_error &e) { - std::string Msg(e.what()); - assert(Msg.find("symbol_that_does_not_exist") != std::string::npos); - } catch (...) { - assert(false && "There must be cl::sycl::compile_program_error"); - } -} - -int main() { - test(); - - return 0; -} diff --git a/sycl/test/kernel-and-program/cache-build-result.cpp b/sycl/test/kernel-and-program/cache-build-result.cpp deleted file mode 100644 index adf2bf2706d6..000000000000 --- a/sycl/test/kernel-and-program/cache-build-result.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// RUN: %clangxx -fsycl %s -o %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out - -#include - -SYCL_EXTERNAL -void undefined(); - -void test() { - cl::sycl::queue Queue; - - auto Kernel = []() { -#ifdef __SYCL_DEVICE_ONLY__ - undefined(); -#endif - }; - - std::string Msg; - int Result; - - for (int Idx = 0; Idx < 2; ++Idx) { - try { - Queue.submit([&](cl::sycl::handler &CGH) { - CGH.single_task(Kernel); - }); - assert(false && "There must be compilation error"); - } catch (const cl::sycl::compile_program_error &e) { - fprintf(stderr, "Exception: %s, %d\n", e.what(), e.get_cl_code()); - if (Idx == 0) { - Msg = e.what(); - Result = e.get_cl_code(); - } else { - // Exception constantly adds info on its error code in the message - assert(Msg.find_first_of(e.what()) == 0 && "Exception text differs"); - assert(Result == e.get_cl_code() && "Exception code differs"); - } - } catch (...) { - assert(false && "There must be cl::sycl::compile_program_error"); - } - } -} - -int main() { - test(); - - return 0; -} diff --git a/sycl/test/kernel-and-program/get-options.cpp b/sycl/test/kernel-and-program/get-options.cpp deleted file mode 100644 index 6bb889a4c09e..000000000000 --- a/sycl/test/kernel-and-program/get-options.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// RUN: %clangxx -fsycl %s -o %t.out -// RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out - -#include - -#include - -// Check program::get_compile/link/build_options functions - -class KernelName; -void submitKernel() { - cl::sycl::queue q; - q.submit( - [&](cl::sycl::handler &cgh) { cgh.single_task([]() {}); }); -} - -int main() { - const cl::sycl::string_class CompileOpts{"-cl-opt-disable"}; - const cl::sycl::string_class LinkOpts{"-cl-fast-relaxed-math"}; - const cl::sycl::string_class BuildOpts{ - "-cl-opt-disable -cl-fast-relaxed-math"}; - - cl::sycl::context Ctx; - cl::sycl::program PrgA{Ctx}; - assert(PrgA.get_compile_options().empty()); - assert(PrgA.get_link_options().empty()); - assert(PrgA.get_build_options().empty()); - - PrgA.build_with_kernel_type(BuildOpts); - assert(PrgA.get_compile_options().empty()); - assert(PrgA.get_link_options().empty()); - assert(PrgA.get_build_options() == (PrgA.is_host() ? "" : BuildOpts)); - - cl::sycl::program PrgB{Ctx}; - PrgB.compile_with_kernel_type(CompileOpts); - assert(PrgB.get_compile_options() == (PrgB.is_host() ? "" : CompileOpts)); - assert(PrgB.get_link_options().empty()); - assert(PrgB.get_build_options() == (PrgB.is_host() ? "" : CompileOpts)); - - PrgB.link(LinkOpts); - assert(PrgB.get_compile_options() == (PrgB.is_host() ? "" : CompileOpts)); - assert(PrgB.get_link_options() == (PrgB.is_host() ? "" : LinkOpts)); - assert(PrgB.get_build_options() == (PrgB.is_host() ? "" : LinkOpts)); -} diff --git a/sycl/test/kernel-and-program/kernel-and-program-interop.cpp b/sycl/test/kernel-and-program/kernel-and-program-interop.cpp deleted file mode 100644 index 991a313712fa..000000000000 --- a/sycl/test/kernel-and-program/kernel-and-program-interop.cpp +++ /dev/null @@ -1,205 +0,0 @@ -// REQUIRES: opencl - -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL -// RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUNx: %GPU_RUN_PLACEHOLDER %t.out -// RUNx: %ACC_RUN_PLACEHOLDER %t.out - -//==--- kernel-and-program.cpp - SYCL kernel/program test ------------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -#include -#include -#include -#include - -int main() { - // Single task invocation methods - { - cl::sycl::queue q; - int data = 0; - - // OpenCL interoperability kernel invocation - if (!q.is_host()) { - { - cl_int err; - cl::sycl::context ctx = q.get_context(); - cl_context clCtx = ctx.get(); - cl_command_queue clQ = q.get(); - cl_mem clBuffer = - clCreateBuffer(clCtx, CL_MEM_WRITE_ONLY, sizeof(int), NULL, NULL); - err = clEnqueueWriteBuffer(clQ, clBuffer, CL_TRUE, 0, sizeof(int), - &data, 0, NULL, NULL); - assert(err == CL_SUCCESS); - clFinish(clQ); - cl::sycl::program prog(ctx); - prog.build_with_source( - "kernel void SingleTask(global int* a) {*a+=1; }\n"); - q.submit([&](cl::sycl::handler &cgh) { - cgh.set_args(clBuffer); - cgh.single_task(prog.get_kernel("SingleTask")); - }); - q.wait(); - err = clEnqueueReadBuffer(clQ, clBuffer, CL_TRUE, 0, sizeof(int), &data, - 0, NULL, NULL); - clReleaseCommandQueue(clQ); - clReleaseContext(clCtx); - assert(err == CL_SUCCESS); - assert(data == 1); - } - { - cl::sycl::queue sycl_queue; - cl::sycl::program prog(sycl_queue.get_context()); - prog.build_with_source("kernel void foo(global int* a, global int* b, " - "global int* c) {*a=*b+*c; }\n"); - int a = 13, b = 14, c = 15; - { - cl::sycl::buffer bufa(&a, cl::sycl::range<1>(1)); - cl::sycl::buffer bufb(&b, cl::sycl::range<1>(1)); - cl::sycl::buffer bufc(&c, cl::sycl::range<1>(1)); - sycl_queue.submit([&](cl::sycl::handler &cgh) { - auto A = bufa.get_access(cgh); - auto B = bufb.get_access(cgh); - auto C = bufc.get_access(cgh); - cgh.set_args(A, B, C); - cgh.single_task(prog.get_kernel("foo")); - }); - } - assert(a == b + c); - } - } - { - cl::sycl::queue Queue; - if (!Queue.is_host()) { - cl::sycl::sampler first( - cl::sycl::coordinate_normalization_mode::normalized, - cl::sycl::addressing_mode::clamp, cl::sycl::filtering_mode::linear); - cl::sycl::sampler second( - cl::sycl::coordinate_normalization_mode::unnormalized, - cl::sycl::addressing_mode::clamp_to_edge, - cl::sycl::filtering_mode::nearest); - cl::sycl::program prog(Queue.get_context()); - prog.build_with_source( - "kernel void sampler_args(int a, sampler_t first, " - "int b, sampler_t second, int c) {}\n"); - cl::sycl::kernel krn = prog.get_kernel("sampler_args"); - - Queue.submit([&](cl::sycl::handler &cgh) { - cgh.set_args(0, first, 2, second, 3); - cgh.single_task(krn); - }); - } - } - } - // Parallel for with range - { - cl::sycl::queue q; - std::vector dataVec(10); - std::iota(dataVec.begin(), dataVec.end(), 0); - - if (!q.is_host()) { - cl_int err; - { - cl::sycl::context ctx = q.get_context(); - cl_context clCtx = ctx.get(); - cl_command_queue clQ = q.get(); - cl_mem clBuffer = clCreateBuffer( - clCtx, CL_MEM_WRITE_ONLY, sizeof(int) * dataVec.size(), NULL, NULL); - err = clEnqueueWriteBuffer(clQ, clBuffer, CL_TRUE, 0, - sizeof(int) * dataVec.size(), dataVec.data(), - 0, NULL, NULL); - assert(err == CL_SUCCESS); - - cl::sycl::program prog(ctx); - prog.build_with_source( - "kernel void ParallelFor(__global int* a, int v, __local int *l) " - "{ size_t index = get_global_id(0); l[index] = a[index];" - " l[index] += v; a[index] = l[index]; }\n"); - - q.submit([&](cl::sycl::handler &cgh) { - const int value = 1; - auto local_acc = - cl::sycl::accessor( - cl::sycl::range<1>(10), cgh); - cgh.set_args(clBuffer, value, local_acc); - cgh.parallel_for(cl::sycl::range<1>(10), - prog.get_kernel("ParallelFor")); - }); - - q.wait(); - err = clEnqueueReadBuffer(clQ, clBuffer, CL_TRUE, 0, - sizeof(int) * dataVec.size(), dataVec.data(), - 0, NULL, NULL); - clReleaseCommandQueue(clQ); - clReleaseContext(clCtx); - assert(err == CL_SUCCESS); - for (size_t i = 0; i < dataVec.size(); ++i) { - assert(dataVec[i] == i + 1); - } - } - } - } - - // Parallel for with nd_range - { - cl::sycl::queue q; - std::vector dataVec(10); - std::iota(dataVec.begin(), dataVec.end(), 0); - - if (!q.is_host()) { - cl_int err; - { - cl::sycl::context ctx = q.get_context(); - cl_context clCtx = ctx.get(); - cl_command_queue clQ = q.get(); - cl_mem clBuffer = clCreateBuffer( - clCtx, CL_MEM_WRITE_ONLY, sizeof(int) * dataVec.size(), NULL, NULL); - err = clEnqueueWriteBuffer(clQ, clBuffer, CL_TRUE, 0, - sizeof(int) * dataVec.size(), dataVec.data(), - 0, NULL, NULL); - assert(err == CL_SUCCESS); - - cl::sycl::program prog(ctx); - prog.build_with_source( - "kernel void ParallelForND( local int* l,global int* a)" - "{ size_t idx = get_global_id(0);" - " int pos = idx & 1;" - " int opp = pos ^ 1;" - " l[pos] = a[get_global_id(0)];" - " barrier(CLK_LOCAL_MEM_FENCE);" - " a[idx]=l[opp]; }"); - - // TODO is there no way to set local memory size via interoperability? - cl::sycl::kernel krn = prog.get_kernel("ParallelForND"); - clSetKernelArg(krn.get(), 0, sizeof(int) * 2, NULL); - - q.submit([&](cl::sycl::handler &cgh) { - cgh.set_arg(1, clBuffer); - cgh.parallel_for(cl::sycl::nd_range<1>(cl::sycl::range<1>(10), - cl::sycl::range<1>(2)), - krn); - }); - - q.wait(); - err = clEnqueueReadBuffer(clQ, clBuffer, CL_TRUE, 0, - sizeof(int) * dataVec.size(), dataVec.data(), - 0, NULL, NULL); - clReleaseCommandQueue(clQ); - clReleaseContext(clCtx); - assert(err == CL_SUCCESS); - } - for (size_t i = 0; i < dataVec.size(); ++i) { - assert(dataVec[i] == (i ^ 1)); - } - } - } -} diff --git a/sycl/test/kernel-and-program/kernel-and-program.cpp b/sycl/test/kernel-and-program/kernel-and-program.cpp deleted file mode 100644 index 1233ec3664ee..000000000000 --- a/sycl/test/kernel-and-program/kernel-and-program.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUNx: %GPU_RUN_PLACEHOLDER %t.out -// RUNx: %ACC_RUN_PLACEHOLDER %t.out - -//==--- kernel-and-program.cpp - SYCL kernel/program test ------------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -#include -#include -#include -#include - -int main() { - - // Single task invocation methods - { - cl::sycl::queue q; - int data = 0; - // Precompiled kernel invocation - { - cl::sycl::buffer buf(&data, cl::sycl::range<1>(1)); - cl::sycl::program prg(q.get_context()); - // Test program building - assert(prg.get_state() == cl::sycl::program_state::none); - prg.build_with_kernel_type(); - assert(prg.get_state() == cl::sycl::program_state::linked); - assert(prg.has_kernel()); - cl::sycl::kernel krn = prg.get_kernel(); - assert(krn.get_context() == q.get_context()); - assert(krn.get_program() == prg); - - q.submit([&](cl::sycl::handler &cgh) { - auto acc = buf.get_access(cgh); - cgh.single_task(krn, [=]() { acc[0] = acc[0] + 1; }); - }); - if (!q.is_host()) { - const std::string integrationHeaderKernelName = - cl::sycl::detail::KernelInfo::getName(); - const std::string clKerneName = - krn.get_info(); - assert(integrationHeaderKernelName == clKerneName); - } - } - assert(data == 1); - - } - // Parallel for with range - { - cl::sycl::queue q; - std::vector dataVec(10); - std::iota(dataVec.begin(), dataVec.end(), 0); - // Precompiled kernel invocation - { - cl::sycl::range<1> numOfItems(dataVec.size()); - cl::sycl::buffer buf(dataVec.data(), numOfItems); - cl::sycl::program prg(q.get_context()); - assert(prg.get_state() == cl::sycl::program_state::none); - // Test compiling -> linking - prg.compile_with_kernel_type(); - assert(prg.get_state() == cl::sycl::program_state::compiled); - prg.link(); - assert(prg.get_state() == cl::sycl::program_state::linked); - assert(prg.has_kernel()); - cl::sycl::kernel krn = prg.get_kernel(); - assert(krn.get_context() == q.get_context()); - assert(krn.get_program() == prg); - - q.submit([&](cl::sycl::handler &cgh) { - auto acc = buf.get_access(cgh); - cgh.parallel_for( - krn, numOfItems, - [=](cl::sycl::id<1> wiID) { acc[wiID] = acc[wiID] + 1; }); - }); - } - for (size_t i = 0; i < dataVec.size(); ++i) { - assert(dataVec[i] == i + 1); - } - } - - // Parallel for with nd_range - { - cl::sycl::queue q; - std::vector dataVec(10); - std::iota(dataVec.begin(), dataVec.end(), 0); - - // Precompiled kernel invocation - // TODO run on host as well once local barrier is supported - if (!q.is_host()) { - { - cl::sycl::range<1> numOfItems(dataVec.size()); - cl::sycl::range<1> localRange(2); - cl::sycl::buffer buf(dataVec.data(), numOfItems); - cl::sycl::program prg(q.get_context()); - assert(prg.get_state() == cl::sycl::program_state::none); - prg.build_with_kernel_type(); - assert(prg.get_state() == cl::sycl::program_state::linked); - assert(prg.has_kernel()); - cl::sycl::kernel krn = prg.get_kernel(); - assert(krn.get_context() == q.get_context()); - assert(krn.get_program() == prg); - - q.submit([&](cl::sycl::handler &cgh) { - auto acc = buf.get_access(cgh); - cl::sycl::accessor - localAcc(localRange, cgh); - - cgh.parallel_for( - krn, cl::sycl::nd_range<1>(numOfItems, localRange), - [=](cl::sycl::nd_item<1> item) { - size_t idx = item.get_global_linear_id(); - int pos = idx & 1; - int opp = pos ^ 1; - localAcc[pos] = acc[item.get_global_linear_id()]; - - item.barrier(cl::sycl::access::fence_space::local_space); - - acc[idx] = localAcc[opp]; - }); - }); - } - q.wait(); - for (size_t i = 0; i < dataVec.size(); ++i) { - assert(dataVec[i] == (i ^ 1)); - } - } - } -} diff --git a/sycl/test/kernel_from_file/hw.cpp b/sycl/test/kernel_from_file/hw.cpp deleted file mode 100644 index b7c4e573be65..000000000000 --- a/sycl/test/kernel_from_file/hw.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// UNSUPPORTED: cuda -// CUDA does not support SPIR-V. - -//-fsycl-targets=%sycl_triple -// 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 -// RUN: %clangxx -include %t.h -g %s -o %t.out -lsycl -I %sycl_include -Xclang -verify-ignore-unexpected=note,warning -// RUN: env SYCL_BE=%sycl_be SYCL_USE_KERNEL_SPV=%t.spv %t.out | FileCheck %s -// CHECK: Passed - -// TODO: InvalidTargetTriple: Expects spir-unknown-unknown or spir64-unknown-unknown. Actual target triple is x86_64-unknown-linux-gnu - -#include -#include - -using namespace cl::sycl; - -int main(int argc, char **argv) { - int data = 5; - - try { - queue myQueue; - buffer buf(&data, range<1>(1)); - - event e = myQueue.submit([&](handler& cgh) { - auto ptr = buf.get_access(cgh); - - cgh.single_task([=]() { - ptr[0]++; - }); - }); - e.wait_and_throw(); - - } catch (cl::sycl::exception const& e) { - std::cerr << "SYCL exception caught:\n"; - std::cerr << e.what() << "\n"; - return 2; - } - catch (...) { - std::cerr << "unknown exception caught\n"; - return 1; - } - - if (data == 6) { - std::cout << "Passed\n"; - return 0; - } else { - std::cout << "Failed: " << data << "!= 6(gold)\n"; - return 1; - } -} - diff --git a/sycl/test/array_param/array-kernel-param-nested-run.cpp b/sycl/test/kernel_param/array-kernel-param-nested-run.cpp similarity index 97% rename from sycl/test/array_param/array-kernel-param-nested-run.cpp rename to sycl/test/kernel_param/array-kernel-param-nested-run.cpp index 5d08ff010ce3..d36da50b8fca 100755 --- a/sycl/test/array_param/array-kernel-param-nested-run.cpp +++ b/sycl/test/kernel_param/array-kernel-param-nested-run.cpp @@ -2,9 +2,6 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/array_param/array-kernel-param-run.cpp b/sycl/test/kernel_param/array-kernel-param-run.cpp similarity index 98% rename from sycl/test/array_param/array-kernel-param-run.cpp rename to sycl/test/kernel_param/array-kernel-param-run.cpp index c26ef53a602f..f7cc3d9391b6 100755 --- a/sycl/test/array_param/array-kernel-param-run.cpp +++ b/sycl/test/kernel_param/array-kernel-param-run.cpp @@ -2,9 +2,6 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/struct_param/non-standard-layout.cpp b/sycl/test/kernel_param/non-standard-layout.cpp similarity index 87% rename from sycl/test/struct_param/non-standard-layout.cpp rename to sycl/test/kernel_param/non-standard-layout.cpp index 7e1ca43cef6b..1acb9b0aac6d 100644 --- a/sycl/test/struct_param/non-standard-layout.cpp +++ b/sycl/test/kernel_param/non-standard-layout.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out #include diff --git a/sycl/test/struct_param/struct_kernel_param.cpp b/sycl/test/kernel_param/struct_kernel_param.cpp similarity index 96% rename from sycl/test/struct_param/struct_kernel_param.cpp rename to sycl/test/kernel_param/struct_kernel_param.cpp index 7162cd872c61..1a6490ef2342 100644 --- a/sycl/test/struct_param/struct_kernel_param.cpp +++ b/sycl/test/kernel_param/struct_kernel_param.cpp @@ -1,9 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// TODO: Uncomment once test is fixed on GPU -// RUNx: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out //==-struct_kernel_param.cpp-Checks passing structs as kernel params--------==// // diff --git a/sycl/test/union_param/union_kernel_param.cpp b/sycl/test/kernel_param/union_kernel_param.cpp similarity index 88% rename from sycl/test/union_param/union_kernel_param.cpp rename to sycl/test/kernel_param/union_kernel_param.cpp index adfa818dd177..4b0980537e4c 100644 --- a/sycl/test/union_param/union_kernel_param.cpp +++ b/sycl/test/kernel_param/union_kernel_param.cpp @@ -2,9 +2,6 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/multi_ptr/multi_ptr.cpp b/sycl/test/multi_ptr/multi_ptr.cpp index 3d80ded38530..dea8dd3ee22a 100644 --- a/sycl/test/multi_ptr/multi_ptr.cpp +++ b/sycl/test/multi_ptr/multi_ptr.cpp @@ -1,13 +1,7 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out // RUN: %clangxx -DRESTRICT_WRITE_ACCESS_TO_CONSTANT_PTR -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization %s -o %t1.out // RUN: env SYCL_DEVICE_TYPE=HOST %t1.out -// RUN: %CPU_RUN_PLACEHOLDER %t1.out -// RUN: %GPU_RUN_PLACEHOLDER %t1.out -// RUN: %ACC_RUN_PLACEHOLDER %t1.out //==--------------- multi_ptr.cpp - SYCL multi_ptr test --------------------==// // From ac7255df1087068ac5f4f9031d18d9c7936ad5b7 Mon Sep 17 00:00:00 2001 From: vladimirlaz Date: Wed, 21 Oct 2020 08:14:29 +0300 Subject: [PATCH 2/2] [SYCL] remove tests added to llvm-test-suite(2) (#2659) Tests which do no support host execution are removed. Other tests are limited to compilation and execution on host device. PR for adding tests to llvm-test-suite: intel/llvm-test-suite#37 --- sycl/test/atomic_ref/accessor.cpp | 2 - sycl/test/atomic_ref/add.cpp | 2 - sycl/test/atomic_ref/compare_exchange.cpp | 2 - sycl/test/atomic_ref/exchange.cpp | 2 - sycl/test/atomic_ref/load.cpp | 2 - sycl/test/atomic_ref/max.cpp | 2 - sycl/test/atomic_ref/min.cpp | 2 - sycl/test/atomic_ref/store.cpp | 2 - sycl/test/atomic_ref/sub.cpp | 2 - sycl/test/bit_cast/bit_cast.cpp | 3 - sycl/test/enqueue_barrier/enqueue_barrier.cpp | 78 --------- sycl/test/inorder_queue/in_order_buffs.cpp | 65 ------- .../test/inorder_queue/in_order_buffs_ocl.cpp | 50 ------ sycl/test/inorder_queue/in_order_dmemll.cpp | 97 ----------- .../inorder_queue/in_order_dmemll_ocl.cpp | 46 ----- sycl/test/inorder_queue/in_order_kernels.cpp | 72 -------- sycl/test/inorder_queue/prop.cpp | 67 -------- sycl/test/multisource/multisource.cpp | 6 - sycl/test/program_manager/env_vars.cpp | 45 ----- sycl/test/program_manager/program_manager.cpp | 58 ------- sycl/test/regression/atomic_load.cpp | 4 +- sycl/test/regression/builtins_vector1.cpp | 3 +- sycl/test/regression/cache_test.cpp | 158 ------------------ .../test/regression/complex_global_object.cpp | 8 +- .../regression/fp16-with-unnamed-lambda.cpp | 2 +- sycl/test/regression/get_subgroup_sizes.cpp | 27 --- sycl/test/regression/global_queue.cpp | 3 - sycl/test/regression/group.cpp | 3 - sycl/test/regression/image_access.cpp | 50 ------ .../regression/implicit_atomic_conversion.cpp | 2 - .../regression/implicit_offset_debug_info.cpp | 20 --- sycl/test/regression/kernel_name_class.cpp | 5 +- .../kernel_name_inside_sycl_namespace.cpp | 3 - sycl/test/regression/kernel_unnamed.cpp | 3 - sycl/test/regression/msvc_crt.cpp | 4 +- sycl/test/regression/pi_release.cpp | 13 -- .../regression/private_array_init_test.cpp | 4 +- sycl/test/regression/same_unnamed_kernels.cpp | 2 +- sycl/test/regression/static-buffer-dtor.cpp | 4 +- sycl/test/regression/sycl-include-gnu11.cpp | 3 - sycl/test/scheduler/BasicSchedulerTests.cpp | 3 - .../scheduler/CommandCleanupThreadSafety.cpp | 40 ----- sycl/test/scheduler/DataMovement.cpp | 8 +- sycl/test/scheduler/HandleException.cpp | 50 ------ sycl/test/scheduler/HostAccDestruction.cpp | 35 ---- sycl/test/scheduler/MemObjRemapping.cpp | 83 --------- sycl/test/scheduler/MultipleDevices.cpp | 48 ------ sycl/test/scheduler/ReleaseResourcesTest.cpp | 12 -- sycl/test/separate-compile/same-kernel.cpp | 3 - sycl/test/separate-compile/sycl-external.cpp | 6 - sycl/test/separate-compile/test.cpp | 2 - 51 files changed, 14 insertions(+), 1202 deletions(-) delete mode 100644 sycl/test/enqueue_barrier/enqueue_barrier.cpp delete mode 100644 sycl/test/inorder_queue/in_order_buffs.cpp delete mode 100644 sycl/test/inorder_queue/in_order_buffs_ocl.cpp delete mode 100644 sycl/test/inorder_queue/in_order_dmemll.cpp delete mode 100644 sycl/test/inorder_queue/in_order_dmemll_ocl.cpp delete mode 100644 sycl/test/inorder_queue/in_order_kernels.cpp delete mode 100644 sycl/test/inorder_queue/prop.cpp delete mode 100644 sycl/test/program_manager/env_vars.cpp delete mode 100644 sycl/test/program_manager/program_manager.cpp delete mode 100644 sycl/test/regression/cache_test.cpp delete mode 100644 sycl/test/regression/get_subgroup_sizes.cpp delete mode 100644 sycl/test/regression/image_access.cpp delete mode 100644 sycl/test/regression/implicit_offset_debug_info.cpp delete mode 100644 sycl/test/regression/pi_release.cpp delete mode 100644 sycl/test/scheduler/CommandCleanupThreadSafety.cpp delete mode 100644 sycl/test/scheduler/HandleException.cpp delete mode 100644 sycl/test/scheduler/HostAccDestruction.cpp delete mode 100644 sycl/test/scheduler/MemObjRemapping.cpp diff --git a/sycl/test/atomic_ref/accessor.cpp b/sycl/test/atomic_ref/accessor.cpp index 6410749cf487..5e488a578f2b 100644 --- a/sycl/test/atomic_ref/accessor.cpp +++ b/sycl/test/atomic_ref/accessor.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/add.cpp b/sycl/test/atomic_ref/add.cpp index 565048f1be25..decf99a6dec8 100644 --- a/sycl/test/atomic_ref/add.cpp +++ b/sycl/test/atomic_ref/add.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/compare_exchange.cpp b/sycl/test/atomic_ref/compare_exchange.cpp index db8b12a84649..5dce9390c998 100644 --- a/sycl/test/atomic_ref/compare_exchange.cpp +++ b/sycl/test/atomic_ref/compare_exchange.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/exchange.cpp b/sycl/test/atomic_ref/exchange.cpp index 61e1114b0c1b..755b40d75c1a 100644 --- a/sycl/test/atomic_ref/exchange.cpp +++ b/sycl/test/atomic_ref/exchange.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/load.cpp b/sycl/test/atomic_ref/load.cpp index 4e044dc7541f..1e0c5c2b8979 100644 --- a/sycl/test/atomic_ref/load.cpp +++ b/sycl/test/atomic_ref/load.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/max.cpp b/sycl/test/atomic_ref/max.cpp index 2bc7067e0165..6dc4db05f968 100644 --- a/sycl/test/atomic_ref/max.cpp +++ b/sycl/test/atomic_ref/max.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/min.cpp b/sycl/test/atomic_ref/min.cpp index 05e41bb36597..2e5f03c2ec0e 100644 --- a/sycl/test/atomic_ref/min.cpp +++ b/sycl/test/atomic_ref/min.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/store.cpp b/sycl/test/atomic_ref/store.cpp index 4c29e8947ea7..c191794a0ef7 100644 --- a/sycl/test/atomic_ref/store.cpp +++ b/sycl/test/atomic_ref/store.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/atomic_ref/sub.cpp b/sycl/test/atomic_ref/sub.cpp index a51ad5a2e9e2..d3ca9fe09672 100644 --- a/sycl/test/atomic_ref/sub.cpp +++ b/sycl/test/atomic_ref/sub.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include #include diff --git a/sycl/test/bit_cast/bit_cast.cpp b/sycl/test/bit_cast/bit_cast.cpp index fcca0a8b2bfd..5c6c1ad3504d 100644 --- a/sycl/test/bit_cast/bit_cast.cpp +++ b/sycl/test/bit_cast/bit_cast.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out #include diff --git a/sycl/test/enqueue_barrier/enqueue_barrier.cpp b/sycl/test/enqueue_barrier/enqueue_barrier.cpp deleted file mode 100644 index a417f230f601..000000000000 --- a/sycl/test/enqueue_barrier/enqueue_barrier.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// RUN: %clangxx -fsycl %s -o %t.out -// RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER -// RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER -// RUN: env SYCL_PI_TRACE=2 %ACC_RUN_PLACEHOLDER %t.out 2>&1 %ACC_CHECK_PLACEHOLDER - -// UNSUPPORTED: cuda - -#include -#include - -int main() { - sycl::context Context; - sycl::queue Q1(Context, sycl::default_selector{}); - - Q1.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - Q1.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - // call handler::barrier() - Q1.submit([&](sycl::handler &cgh) { - cgh.barrier(); - }); - - Q1.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - Q1.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - // call queue::submit_barrier() - Q1.submit_barrier(); - - sycl::queue Q2(Context, sycl::default_selector{}); - sycl::queue Q3(Context, sycl::default_selector{}); - - auto Event1 = Q1.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - auto Event2 = Q2.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - // call handler::barrier(const vector_class &WaitList) - Q3.submit([&](cl::sycl::handler &cgh) { - cgh.barrier({Event1, Event2}); - }); - - Q3.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - auto Event3 = Q1.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - auto Event4 = Q2.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - // call queue::submit_barrier(const vector_class &WaitList) - Q3.submit_barrier({Event3, Event4}); - - Q3.submit([&](sycl::handler &cgh) { - cgh.single_task([]() {}); - }); - - return 0; -} - -// CHECK:---> piEnqueueEventsWaitWithBarrier -// CHECK:---> piEnqueueEventsWaitWithBarrier -// CHECK:---> piEnqueueEventsWaitWithBarrier -// CHECK:---> piEnqueueEventsWaitWithBarrier diff --git a/sycl/test/inorder_queue/in_order_buffs.cpp b/sycl/test/inorder_queue/in_order_buffs.cpp deleted file mode 100644 index be96e3b849f2..000000000000 --- a/sycl/test/inorder_queue/in_order_buffs.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -//==-------- ordered_buffs.cpp - SYCL buffers in ordered queues test--------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#include -#include - -using namespace cl::sycl; - -const int dataSize = 32; - -int main() { - int dataA[dataSize] = {0}; - int dataB[dataSize] = {0}; - - { - queue Queue{property::queue::in_order()}; - - // Purpose of this test is to create a dependency between two kernels - // RAW dependency - // which requires the use of ordered queue. - buffer bufA(dataA, range<1>(dataSize)); - buffer bufB(dataB, range<1>(dataSize)); - Queue.submit([&](handler &cgh) { - auto writeBuffer = bufA.get_access(cgh); - - // Create a range. - auto myRange = range<1>(dataSize); - - // Create a kernel. - auto myKernel = ([=](id<1> idx) { writeBuffer[idx] = idx[0]; }); - - cgh.parallel_for(myRange, myKernel); - }); - - Queue.submit([&](handler &cgh) { - auto writeBuffer = bufB.get_access(cgh); - auto readBuffer = bufA.get_access(cgh); - - // Create a range. - auto myRange = range<1>(dataSize); - - // Create a kernel. - auto myKernel = ([=](id<1> idx) { writeBuffer[idx] = readBuffer[idx]; }); - - cgh.parallel_for(myRange, myKernel); - }); - - auto readBufferB = bufB.get_access(); - for (size_t i = 0; i != dataSize; ++i) { - if (readBufferB[i] != i) { - std::cout << "Result mismatches " << readBufferB[i] << " vs expected " - << i << " for index " << i << std::endl; - } - } - } - return 0; -} diff --git a/sycl/test/inorder_queue/in_order_buffs_ocl.cpp b/sycl/test/inorder_queue/in_order_buffs_ocl.cpp deleted file mode 100644 index d42bdd2ec4e0..000000000000 --- a/sycl/test/inorder_queue/in_order_buffs_ocl.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// REQUIRES: opencl - -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL -// RUN: %ACC_RUN_PLACEHOLDER %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -//==-------- ordered_buffs.cpp - SYCL buffers in ordered queues test--------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#include -#include - -using namespace cl::sycl; - -const int dataSize = 32; - -bool isQueueInOrder(cl_command_queue cq) { - cl_command_queue_properties reportedProps; - cl_int iRet = clGetCommandQueueInfo( - cq, CL_QUEUE_PROPERTIES, sizeof(reportedProps), &reportedProps, nullptr); - assert(CL_SUCCESS == iRet && "Failed to obtain queue info from ocl device"); - return (!(reportedProps & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE)); -} - -int main() { - int dataA[dataSize] = {0}; - int dataB[dataSize] = {0}; - - { - queue Queue{property::queue::in_order()}; - - bool result = true; - cl_command_queue cq = Queue.get(); - device dev = Queue.get_device(); - bool expected_result = dev.is_host() ? true : isQueueInOrder(cq); - - if (expected_result != result) { - std::cout << "Resulting queue order is OOO but expected order is inorder" - << std::endl; - - return -1; - } - } - - return 0; -} diff --git a/sycl/test/inorder_queue/in_order_dmemll.cpp b/sycl/test/inorder_queue/in_order_dmemll.cpp deleted file mode 100644 index 00dfbdb8ac16..000000000000 --- a/sycl/test/inorder_queue/in_order_dmemll.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out -// RUN: %CPU_RUN_PLACEHOLDER %t1.out -// RUN: %GPU_RUN_PLACEHOLDER %t1.out -// -//==----------- ordered_dmemll.cpp - Device Memory Linked List test --------==// -// It uses an ordered queue where explicit waiting is not necessary between -// kernels -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -using namespace cl::sycl; - -constexpr int numNodes = 4; - -struct Node { - Node() : pNext(nullptr), Num(0xDEADBEEF) {} - - Node *pNext; - uint32_t Num; -}; - -class foo; -int main() { - queue q{property::queue::in_order()}; - auto dev = q.get_device(); - auto ctxt = q.get_context(); - Node *d_head = nullptr; - Node *d_cur = nullptr; - Node h_cur; - - d_head = (Node *)malloc_device(sizeof(Node), dev, ctxt); - if (d_head == nullptr) { - return -1; - } - d_cur = d_head; - - for (int i = 0; i < numNodes; i++) { - h_cur.Num = i * 2; - - if (i != (numNodes - 1)) { - h_cur.pNext = (Node *)malloc_device(sizeof(Node), dev, ctxt); - if (h_cur.pNext == nullptr) { - return -1; - } - } else { - h_cur.pNext = nullptr; - } - - event e0 = q.memcpy(d_cur, &h_cur, sizeof(Node)); - e0.wait(); - - d_cur = h_cur.pNext; - } - - q.submit([=](handler &cgh) { - cgh.single_task([=]() { - Node *pHead = d_head; - while (pHead) { - pHead->Num = pHead->Num * 2 + 1; - pHead = pHead->pNext; - } - }); - }); - - q.submit([=](handler &cgh) { - cgh.single_task([=]() { - Node *pHead = d_head; - while (pHead) { - pHead->Num = pHead->Num + 42; - pHead = pHead->pNext; - } - }); - }); - - d_cur = d_head; - for (int i = 0; i < numNodes; i++) { - event c = q.memcpy(&h_cur, d_cur, sizeof(Node)); - c.wait(); - free(d_cur, ctxt); - - const int want = i * 4 + 43; - if (h_cur.Num != want) { - std::cout << "Result mismatches " << h_cur.Num << " vs expected " - << i * 4 + 43 << " for index " << i << std::endl; - return -1; - } - d_cur = h_cur.pNext; - } - - return 0; -} diff --git a/sycl/test/inorder_queue/in_order_dmemll_ocl.cpp b/sycl/test/inorder_queue/in_order_dmemll_ocl.cpp deleted file mode 100644 index e5fb04e2b1e9..000000000000 --- a/sycl/test/inorder_queue/in_order_dmemll_ocl.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// REQUIRES: opencl - -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out -L %opencl_libs_dir -lOpenCL -// RUN: %CPU_RUN_PLACEHOLDER %t1.out -// RUN: %GPU_RUN_PLACEHOLDER %t1.out -//==----------- ordered_dmemll.cpp - Device Memory Linked List test --------==// -// It uses an ordered queue where explicit waiting is not necessary between -// kernels -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -using namespace cl::sycl; - -constexpr int numNodes = 4; - -bool getQueueOrder(cl_command_queue cq) { - cl_command_queue_properties reportedProps; - cl_int iRet = clGetCommandQueueInfo( - cq, CL_QUEUE_PROPERTIES, sizeof(reportedProps), &reportedProps, nullptr); - assert(CL_SUCCESS == iRet && "Failed to obtain queue info from ocl device"); - return (reportedProps & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) ? false - : true; -} - -int main() { - queue q{property::queue::in_order()}; - auto dev = q.get_device(); - - bool result = true; - cl_command_queue cq = q.get(); - bool expected_result = dev.is_host() ? true : getQueueOrder(cq); - if (expected_result != result) { - std::cout << "Resulting queue order is OOO but expected order is inorder" - << std::endl; - - return -1; - } - - return 0; -} diff --git a/sycl/test/inorder_queue/in_order_kernels.cpp b/sycl/test/inorder_queue/in_order_kernels.cpp deleted file mode 100644 index 60cf112c35db..000000000000 --- a/sycl/test/inorder_queue/in_order_kernels.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// UNSUPPORTED: cuda -// CUDA does not support unnamed lambdas. -// -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-unnamed-lambda %s -o %t.out -// RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out - -//==------ oq_kernels.cpp - SYCL ordered queue kernel shortcut test --------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include -#include -using namespace cl::sycl; - -int main() { - queue q{property::queue::in_order()}; - auto dev = q.get_device(); - auto ctx = q.get_context(); - const int N = 8; - - if (dev.get_info()) { - auto A = (int *)malloc_shared(N * sizeof(int), dev, ctx); - - for (int i = 0; i < N; i++) { - A[i] = 1; - } - - q.parallel_for(range<1>{N}, [=](id<1> ID) { - auto i = ID[0]; - A[i]++; - }); - - q.parallel_for(range<1>{N}, [=](id<1> ID) { - auto i = ID[0]; - A[i]++; - }); - - q.single_task([=]() { - for (int i = 0; i < N; i++) { - A[i]++; - } - }); - - id<1> offset(0); - q.parallel_for(range<1>{N}, offset, [=](id<1> ID) { - auto i = ID[0]; - A[i]++; - }); - - nd_range<1> NDR(range<1>{N}, range<1>{2}); - q.parallel_for(NDR, [=](nd_item<1> Item) { - auto i = Item.get_global_id(0); - A[i]++; - }); - - q.wait(); - - for (int i = 0; i < N; i++) { - if (A[i] != 6) - return 1; - } - } - - return 0; -} diff --git a/sycl/test/inorder_queue/prop.cpp b/sycl/test/inorder_queue/prop.cpp deleted file mode 100644 index e1ce2f9d5529..000000000000 --- a/sycl/test/inorder_queue/prop.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// REQUIRES: opencl - -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out -L %opencl_libs_dir -lOpenCL -// RUN: %CPU_RUN_PLACEHOLDER %t1.out -// RUN: %GPU_RUN_PLACEHOLDER %t1.out - -//==----------- ordered_dmemll.cpp - Device Memory Linked List test --------==// -// It uses an ordered queue where explicit waiting is not necessary between -// kernels -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -using namespace cl::sycl; - -constexpr int numNodes = 4; - -bool getQueueOrder(cl_command_queue cq) { - cl_command_queue_properties reportedProps; - cl_int iRet = clGetCommandQueueInfo( - cq, CL_QUEUE_PROPERTIES, sizeof(reportedProps), &reportedProps, nullptr); - assert(CL_SUCCESS == iRet && "Failed to obtain queue info from ocl device"); - return (reportedProps & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) ? false - : true; -} - -int CheckQueueOrder(const queue &q) { - auto dev = q.get_device(); - - cl_command_queue cq = q.get(); - bool expected_result = dev.is_host() ? true : getQueueOrder(cq); - if (!expected_result) - return -1; - - expected_result = dev.is_host() ? true : q.is_in_order(); - if (!expected_result) - return -2; - - return 0; -} - -int main() { - queue q1{property::queue::in_order()}; - int res = CheckQueueOrder(q1); - if (res != 0) - return res; - - device dev{cl::sycl::default_selector{}}; - context ctx{dev}; - - auto exception_handler = [](cl::sycl::exception_list exceptions) { - }; - - queue q2{ - ctx, dev, exception_handler, {sycl::property::queue::in_order()}}; - - res = CheckQueueOrder(q2); - if (res != 0) - return res; - - return 0; -} diff --git a/sycl/test/multisource/multisource.cpp b/sycl/test/multisource/multisource.cpp index edcd46dfee83..0797b37ab4e0 100644 --- a/sycl/test/multisource/multisource.cpp +++ b/sycl/test/multisource/multisource.cpp @@ -11,9 +11,6 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -c -o %t.main.o %s -DMAIN_APP // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %t.kernel.o %t.main.o -o %t.fat // RUN: env SYCL_DEVICE_TYPE=HOST %t.fat -// RUN: %CPU_RUN_PLACEHOLDER %t.fat -// RUN: %GPU_RUN_PLACEHOLDER %t.fat -// RUN: %ACC_RUN_PLACEHOLDER %t.fat // Multiple sources with kernel code // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -c -o %t.init.o %s -DINIT_KERNEL @@ -21,9 +18,6 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -c -o %t.main.o %s -DMAIN_APP // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %t.init.o %t.calc.o %t.main.o -o %t.fat // RUN: env SYCL_DEVICE_TYPE=HOST %t.fat -// RUN: %CPU_RUN_PLACEHOLDER %t.fat -// RUN: %GPU_RUN_PLACEHOLDER %t.fat -// RUN: %ACC_RUN_PLACEHOLDER %t.fat #include diff --git a/sycl/test/program_manager/env_vars.cpp b/sycl/test/program_manager/env_vars.cpp deleted file mode 100644 index 3f884c0765bc..000000000000 --- a/sycl/test/program_manager/env_vars.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// REQUIRES: opencl -// Env vars are used to pass OpenCL-specific flags to PI compiling/linking. -// -// RUN: %clangxx -O0 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -lsycl -// -// RUN: %CPU_RUN_PLACEHOLDER SYCL_PROGRAM_COMPILE_OPTIONS="-g" %t.out -// RUN: %GPU_RUN_PLACEHOLDER SYCL_PROGRAM_COMPILE_OPTIONS="-g" %t.out -// -// Now test for invalid options to make sure they are really passed to -// a device compiler. Intel GPU runtime doesn't give an error for -// invalid options, so we don't test it here. -// -// RUN: %CPU_RUN_PLACEHOLDER SYCL_PROGRAM_COMPILE_OPTIONS="-enable-link-options -cl-denorms-are-zero" SHOULD_CRASH=1 %t.out - -#include -#include -#include - -using namespace cl::sycl; - -int main() { - int data = 5; - buffer buf(&data, range<1>(1)); - queue myQueue; - if (getenv("SHOULD_CRASH")) { - try { - myQueue.submit([&](handler &cgh) { - auto B = buf.get_access(cgh); - cgh.single_task([=]() { B[0] = 0; }); - }); - } catch (cl::sycl::runtime_error &e) { - // Exit immediately, otherwise the buffer destructor may actually try to - // enqueue the command once again, and throw another exception. - exit(0); - } catch (cl::sycl::compile_program_error &e) { - exit(0); - } - assert(0 && "Expected exception was *not* thrown"); - } else { - myQueue.submit([&](handler &cgh) { - auto B = buf.get_access(cgh); - cgh.single_task([=]() { B[0] = 0; }); - }); - } -} diff --git a/sycl/test/program_manager/program_manager.cpp b/sycl/test/program_manager/program_manager.cpp deleted file mode 100644 index 7ef97c9f1325..000000000000 --- a/sycl/test/program_manager/program_manager.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -I %sycl_source_dir %s -o %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out -// TODO rewrite as unit test -// XFAIL: * - -//==--- program_manager.cpp - SYCL program manager test --------------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include -#include -#include -#include - -#include -#include - -using namespace cl::sycl; - -class KernelNameT; - -int main() { - context ContextFirst; - context ContextSecond; - - auto &PM = detail::ProgramManager::getInstance(); - auto M = detail::OSUtil::ExeModuleHandle; - - string_class KernelNameStr = detail::KernelInfo::getName(); - const detail::RT::PiProgram ClProgramFirst = - PM.getBuiltPIProgram(M, ContextFirst, KernelNameStr); - const detail::RT::PiProgram ClProgramSecond = - PM.getBuiltPIProgram(M, ContextSecond, KernelNameStr); - // The check what getBuiltOpenCLProgram returns unique cl_program for unique - // context - assert(ClProgramFirst != ClProgramSecond); - for (size_t i = 0; i < 10; ++i) { - const detail::RT::PiProgram ClProgramFirstNew = - PM.getBuiltPIProgram(M, ContextFirst, KernelNameStr); - const detail::RT::PiProgram ClProgramSecondNew = - PM.getBuiltPIProgram(M, ContextSecond, KernelNameStr); - // The check what getBuiltOpenCLProgram returns the same program for the - // same context each time - assert(ClProgramFirst == ClProgramFirstNew); - assert(ClProgramSecond == ClProgramSecondNew); - } - - queue q; - q.submit([&](handler &cgh) { cgh.single_task([]() {}); }); - - return 0; -} diff --git a/sycl/test/regression/atomic_load.cpp b/sycl/test/regression/atomic_load.cpp index ea3d16d0fe43..bff99f2c49a6 100644 --- a/sycl/test/regression/atomic_load.cpp +++ b/sycl/test/regression/atomic_load.cpp @@ -1,5 +1,5 @@ // RUN: %clangxx -fsycl %s -o %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out +// RUN: env SYCL_DEVICE_TYPE=HOST %t.out #include using namespace cl::sycl; @@ -26,4 +26,4 @@ int main() { kernel_func(5.5); kernel_func(42); return 0; -} \ No newline at end of file +} diff --git a/sycl/test/regression/builtins_vector1.cpp b/sycl/test/regression/builtins_vector1.cpp index 2b02675164ad..8d3d869f5622 100644 --- a/sycl/test/regression/builtins_vector1.cpp +++ b/sycl/test/regression/builtins_vector1.cpp @@ -1,6 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out #include @@ -20,4 +19,4 @@ int main() { assert(scalarRes - 1.0f < 1e-5); }); }); -} \ No newline at end of file +} diff --git a/sycl/test/regression/cache_test.cpp b/sycl/test/regression/cache_test.cpp deleted file mode 100644 index 18a1dc6aabff..000000000000 --- a/sycl/test/regression/cache_test.cpp +++ /dev/null @@ -1,158 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -I %sycl_include/../ %s -o %t.out -L %sycl_libs_dir -lze_loader -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out - -// REQUIRES: level_zero - -#include -#include -#include - -#include -#include - -/* - The purpose of this test is to verify the expected behvior for - creating/caching platform and device objects. The available platforms and - devices (returned from get_platforms() and get_devices()) should remain - consistent throughout the lifetime of the application. Any new platform or - device queried should be one that is a part of the original list of platforms - and devices generated from get_platforms() and get_devices(). This test will - verify that in the following ways: - - Query for a list of all of the available platforms and devices - - Create a Queue using a default device selector and verify that the device - and platform associated with the queue can be found in the original - devices and platforms lists. - - Create both a platform and a device object using a native handle, and - verify that they are in the original platform and device lists. - This test will fail if it tries to create a platform or device that was not - in the list of platforms and devices queried in the begininning. -*/ - -// Query the device and platform from a queue (constructed with a default device -// selector) and check if they can be found in the devices and platforms lists -// that were generated above. -int queryFromQueue(std::vector *platform_list, - std::vector *device_list) { - int failures = 0; - cl::sycl::queue Q{cl::sycl::default_selector{}}; - cl::sycl::device dev = Q.get_info(); - auto plt = dev.get_platform(); - - std::cout << "Platform queried from Queue : " - << plt.get_info() << std::endl; - auto plt_result = - std::find_if(platform_list->begin(), platform_list->end(), - [&](cl::sycl::platform &p) { return p == plt; }); - if (plt_result != platform_list->end()) { - std::cout << "The platform list contains: " - << plt.get_info() << std::endl; - } else { - std::cout << plt.get_info() - << " was not in the platform list.\n"; - failures++; - } - - std::cout << "Device queried from Queue : " - << plt.get_info() << std::endl; - auto dev_result = std::find_if(device_list->begin(), device_list->end(), - [&](cl::sycl::device &d) { return d == dev; }); - if (dev_result != device_list->end()) { - std::cout << "The device list contains: " - << dev.get_info() << std::endl; - } else { - std::cout << dev.get_info() - << " was not in the device list.\n"; - failures++; - } - return failures; -} - -// Create both a platform and a device object using a native handle, and check -// if those are in the platform and device lists. -int queryFromNativeHandle(std::vector *platform_list, - std::vector *device_list) { - int failures = 0; - uint32_t l0_driver_count = 0; - zeDriverGet(&l0_driver_count, nullptr); - if (l0_driver_count == 0) { - std::cout << "There is no Level Zero Driver available\n"; - return failures; - } - std::vector l0_drivers(l0_driver_count); - zeDriverGet(&l0_driver_count, l0_drivers.data()); - - uint32_t l0_device_count = 0; - zeDeviceGet(l0_drivers[0], &l0_device_count, nullptr); - if (l0_device_count == 0) { - std::cout << "There is no Level Zero Device available\n"; - return failures; - } - std::vector l0_devices(l0_device_count); - zeDeviceGet(l0_drivers[0], &l0_device_count, l0_devices.data()); - - // Create the platform and device objects using the native handle. - auto plt = cl::sycl::level_zero::make(l0_drivers[0]); - auto dev = cl::sycl::level_zero::make(plt, l0_devices[0]); - - // Check to see if this platform is in the platform list. - std::cout << "Platform created with native handle: " - << plt.get_info() << std::endl; - auto plt_result = - std::find_if(platform_list->begin(), platform_list->end(), - [&](cl::sycl::platform &p) { return p == plt; }); - if (plt_result != platform_list->end()) { - std::cout << "The platform list contains: " - << plt.get_info() << std::endl; - } else { - std::cout << plt.get_info() - << " was not in the platform list.\n"; - failures++; - } - - // Check to see if this device is in the device list. - std::cout << "Device created with native handle: " - << dev.get_info() << std::endl; - auto dev_result = std::find_if(device_list->begin(), device_list->end(), - [&](cl::sycl::device &d) { return d == dev; }); - if (dev_result != device_list->end()) { - std::cout << "The device list contains: " - << dev.get_info() << std::endl; - } else { - std::cout << dev.get_info() - << " was not in the device list.\n"; - failures++; - } - return failures; -} - -int main() { - int failures = 0; - - // Query for a list of all of the available platforms and devices. - int pindex = 1; - std::vector platform_list; - std::vector device_list; - for (const auto &plt : cl::sycl::platform::get_platforms()) { - std::cout << "Platform " << pindex++ << " " - << ((plt.is_host()) ? "host" : "") << " (" - << plt.get_info() << ")" - << std::endl; - platform_list.push_back(plt); - - int dindex = 1; - for (const auto &dev : plt.get_devices()) { - std::cout << " " - << "Device " << dindex++ << " (" - << dev.get_info() << ")" - << std::endl; - device_list.push_back(dev); - } - } - - failures = queryFromQueue(&platform_list, &device_list); - failures += queryFromNativeHandle(&platform_list, &device_list); - - return failures; -} diff --git a/sycl/test/regression/complex_global_object.cpp b/sycl/test/regression/complex_global_object.cpp index 0f7b1f19ec18..f6a190658b71 100644 --- a/sycl/test/regression/complex_global_object.cpp +++ b/sycl/test/regression/complex_global_object.cpp @@ -1,11 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out -// REQUIRES: opencl -// TODO enable test on GPUs once drivers are fixed -// UNSUPPORTED: gpu +// RUN: env SYCL_DEVICE_TYPE=host %t.out // SYCL runtime may construct global objects at function scope. The test ensures // such objects do not cause problems if the first call to SYCL is inside main diff --git a/sycl/test/regression/fp16-with-unnamed-lambda.cpp b/sycl/test/regression/fp16-with-unnamed-lambda.cpp index ead806dcce68..861f5498c465 100644 --- a/sycl/test/regression/fp16-with-unnamed-lambda.cpp +++ b/sycl/test/regression/fp16-with-unnamed-lambda.cpp @@ -1,5 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-unnamed-lambda %s -o %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out +// RUN: env SYCL_DEVICE_TYPE=host %t.out #include #include diff --git a/sycl/test/regression/get_subgroup_sizes.cpp b/sycl/test/regression/get_subgroup_sizes.cpp deleted file mode 100644 index 2f5901952cbf..000000000000 --- a/sycl/test/regression/get_subgroup_sizes.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out - -//==-- get_subgroup_sizes.cpp - Test for bug fix in subgroup sizes query --==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -using namespace cl::sycl; - -int main() { - queue Q; - auto Dev = Q.get_device(); - if (Dev.has_extension("cl_intel_required_subgroup_size")) { - cl::sycl::vector_class SubGroupSizes = - Dev.get_info(); - cl::sycl::vector_class::const_iterator MaxIter = - std::max_element(SubGroupSizes.begin(), SubGroupSizes.end()); - int MaxSubGroup_size = *MaxIter; - } - return 0; -} diff --git a/sycl/test/regression/global_queue.cpp b/sycl/test/regression/global_queue.cpp index 8191b7efeca4..ce4a8102256e 100644 --- a/sycl/test/regression/global_queue.cpp +++ b/sycl/test/regression/global_queue.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out // SYCL dependencies (i.e. low level runtimes) may have global objects of their // own. The test ensures, that those objects do not cause problems. When host diff --git a/sycl/test/regression/group.cpp b/sycl/test/regression/group.cpp index c53dc3cc6436..9ac8f64c7bf4 100644 --- a/sycl/test/regression/group.cpp +++ b/sycl/test/regression/group.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out //==-- group.cpp - Regression tests for cl::sycl::group API bug fixes. -----==// // diff --git a/sycl/test/regression/image_access.cpp b/sycl/test/regression/image_access.cpp deleted file mode 100644 index e779fb5b4111..000000000000 --- a/sycl/test/regression/image_access.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER -// RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER -// TODO: For now PI checks are skipped for ACC device. To decide if it's good. -// RUN: env %ACC_RUN_PLACEHOLDER %t.out -// -// UNSUPPORTED: cuda || windows && level_zero -// CUDA cannot support OpenCL spec conform images. -// TODO: test hangs on level_zero, enable when fixed. - -//==-------------- image_access.cpp - SYCL image accessors test -----------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -int main() { - try { - cl::sycl::range<1> Range(32); - std::vector Data(Range.size() * 4, 0.0f); - cl::sycl::image<1> Image(Data.data(), cl::sycl::image_channel_order::rgba, - cl::sycl::image_channel_type::fp32, Range); - cl::sycl::queue Queue; - - Queue.submit([&](cl::sycl::handler &CGH) { - cl::sycl::accessor - A(Image, CGH); - CGH.single_task([=]() {}); - }); - Queue.wait_and_throw(); - - cl::sycl::accessor - A(Image); - } catch (cl::sycl::exception &E) { - std::cout << E.what(); - } - return 0; -} - -// CHECK:---> piMemImageCreate -// CHECK:---> piEnqueueMemImageRead diff --git a/sycl/test/regression/implicit_atomic_conversion.cpp b/sycl/test/regression/implicit_atomic_conversion.cpp index 625fe0b50d04..dbe8210dffb7 100644 --- a/sycl/test/regression/implicit_atomic_conversion.cpp +++ b/sycl/test/regression/implicit_atomic_conversion.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out #include diff --git a/sycl/test/regression/implicit_offset_debug_info.cpp b/sycl/test/regression/implicit_offset_debug_info.cpp deleted file mode 100644 index 7826e696c3c7..000000000000 --- a/sycl/test/regression/implicit_offset_debug_info.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: %clangxx -g -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// REQUIRES: cuda - -// NOTE: Tests that the implicit global offset pass copies debug information - -#include -using namespace cl::sycl; - -int main() { - queue q; - buffer t1(10); - q.submit([&](handler &cgh) { - auto table = t1.get_access(cgh); - cgh.parallel_for(10, [=](id<1> gtid) { - table[gtid] = gtid[0]; - }); - }); - q.wait(); -} \ No newline at end of file diff --git a/sycl/test/regression/kernel_name_class.cpp b/sycl/test/regression/kernel_name_class.cpp index dcb154df7032..dfa1572d39a2 100644 --- a/sycl/test/regression/kernel_name_class.cpp +++ b/sycl/test/regression/kernel_name_class.cpp @@ -1,10 +1,7 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.ext.out -fsycl-unnamed-lambda -// RUN: %CPU_RUN_PLACEHOLDER %t.ext.out +// RUN: env SYCL_DEVICE_TYPE=HOST %t.out %t.ext.out //==-- kernel_name_class.cpp - SYCL kernel naming variants test ------------==// // diff --git a/sycl/test/regression/kernel_name_inside_sycl_namespace.cpp b/sycl/test/regression/kernel_name_inside_sycl_namespace.cpp index 77297f82690d..4f46e3227077 100644 --- a/sycl/test/regression/kernel_name_inside_sycl_namespace.cpp +++ b/sycl/test/regression/kernel_name_inside_sycl_namespace.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -D__SYCL_DISABLE_NAMESPACE_INLINE__ %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out //==------- kernel_name_inside_sycl_namespace.cpp - Regression test --------==// // diff --git a/sycl/test/regression/kernel_unnamed.cpp b/sycl/test/regression/kernel_unnamed.cpp index 4b0726552403..ee797e86ed42 100644 --- a/sycl/test/regression/kernel_unnamed.cpp +++ b/sycl/test/regression/kernel_unnamed.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -fsycl-unnamed-lambda // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out //==-- kernel_unnamed.cpp - SYCL kernel naming variants test ------------==// // diff --git a/sycl/test/regression/msvc_crt.cpp b/sycl/test/regression/msvc_crt.cpp index e3022045ae10..8b484f5f7941 100644 --- a/sycl/test/regression/msvc_crt.cpp +++ b/sycl/test/regression/msvc_crt.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cl -fsycl /MD -o %t1.exe %s -// RUN: %CPU_RUN_PLACEHOLDER %t1.exe +// RUN: env SYCL_DEVICE_TYPE=HOST %t1.exe // RUN: %clang_cl -fsycl /MDd -o %t2.exe %s -// RUN: %CPU_RUN_PLACEHOLDER %t2.exe +// RUN: env SYCL_DEVICE_TYPE=HOST %t2.exe // REQUIRES: system-windows //==-------------- msvc_crt.cpp - SYCL MSVC CRT test -----------------------==// // diff --git a/sycl/test/regression/pi_release.cpp b/sycl/test/regression/pi_release.cpp deleted file mode 100644 index 43636d0cf25e..000000000000 --- a/sycl/test/regression/pi_release.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// REQUIRES: cpu -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: env SYCL_PI_TRACE=-1 %CPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck %s - -#include - -int main() { - sycl::queue q; - return 0; -} - -// CHECK: piQueueRelease -// CHECK: piContextRelease diff --git a/sycl/test/regression/private_array_init_test.cpp b/sycl/test/regression/private_array_init_test.cpp index 3c64c627d8d6..82fc6bfe2a78 100644 --- a/sycl/test/regression/private_array_init_test.cpp +++ b/sycl/test/regression/private_array_init_test.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out +// RUN: env SYCL_DEVICE_TYPE=HOST %t.out //==- private_array_init_test.cpp - Regression test for private array init -==// // diff --git a/sycl/test/regression/same_unnamed_kernels.cpp b/sycl/test/regression/same_unnamed_kernels.cpp index 5d8fb1138715..6800dda0aabb 100644 --- a/sycl/test/regression/same_unnamed_kernels.cpp +++ b/sycl/test/regression/same_unnamed_kernels.cpp @@ -1,5 +1,5 @@ // RUN: %clangxx -fsycl %s -o %t.out -fsycl-unnamed-lambda -// RUN: %CPU_RUN_PLACEHOLDER %t.out +// RUN: env SYCL_DEVICE_TYPE=HOST %t.out //==----- same_unnamed_kernels.cpp - SYCL kernel naming variants test ------==// // diff --git a/sycl/test/regression/static-buffer-dtor.cpp b/sycl/test/regression/static-buffer-dtor.cpp index 2c20dce33f28..1f2a25ec9a26 100644 --- a/sycl/test/regression/static-buffer-dtor.cpp +++ b/sycl/test/regression/static-buffer-dtor.cpp @@ -10,9 +10,7 @@ // would start shutting down. //===----------------------------------------------------------------------===// // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out +// RUN: env SYCL_DEVICE_TYPE=HOST %t.out #include diff --git a/sycl/test/regression/sycl-include-gnu11.cpp b/sycl/test/regression/sycl-include-gnu11.cpp index 3004b24f8266..50e5eaefa50e 100644 --- a/sycl/test/regression/sycl-include-gnu11.cpp +++ b/sycl/test/regression/sycl-include-gnu11.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -std=gnu++11 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out // UNSUPPORTED: system-windows diff --git a/sycl/test/scheduler/BasicSchedulerTests.cpp b/sycl/test/scheduler/BasicSchedulerTests.cpp index 1db052997811..0943cb61e5db 100644 --- a/sycl/test/scheduler/BasicSchedulerTests.cpp +++ b/sycl/test/scheduler/BasicSchedulerTests.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -I %sycl_source_dir %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out //==------------------- BasicSchedulerTests.cpp ----------------------------==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. diff --git a/sycl/test/scheduler/CommandCleanupThreadSafety.cpp b/sycl/test/scheduler/CommandCleanupThreadSafety.cpp deleted file mode 100644 index f1d39db4e899..000000000000 --- a/sycl/test/scheduler/CommandCleanupThreadSafety.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// UNSUPPORTED: windows -// RUN: %clangxx -fsycl %s -o %t.out -lpthread -// RUN: %CPU_RUN_PLACEHOLDER %t.out -#include - -#include -#include -#include -#include - -// This test checks that the command graph cleanup works properly when -// invoked from multiple threads. -using namespace cl::sycl; - -class Foo; - -event submitTask(queue &Q, buffer &Buf) { - return Q.submit([&](handler &Cgh) { - auto Acc = Buf.get_access(Cgh); - Cgh.single_task([=]() { Acc[0] = 42; }); - }); -} - -int main() { - queue Q; - buffer Buf(range<1>(1)); - - // Create multiple commands, each one dependent on the previous - std::vector Events; - const std::size_t NTasks = 16; - for (std::size_t I = 0; I < NTasks; ++I) - Events.push_back(submitTask(Q, Buf)); - - // Initiate cleanup from multiple threads - std::vector Threads; - for (event &E : Events) - Threads.emplace_back([&]() { E.wait(); }); - for (std::thread &T : Threads) - T.join(); -} diff --git a/sycl/test/scheduler/DataMovement.cpp b/sycl/test/scheduler/DataMovement.cpp index b2a3c33ba1a6..4694fb6baada 100644 --- a/sycl/test/scheduler/DataMovement.cpp +++ b/sycl/test/scheduler/DataMovement.cpp @@ -1,7 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -I %sycl_source_dir %s -o %t.out -g -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out +// RUN: %t.out // //==-------------------------- DataMovement.cpp ----------------------------==// // @@ -57,8 +55,8 @@ template class CustomAllocator { }; int main() { - TestQueue Queue1(sycl::default_selector{}); - TestQueue Queue2(sycl::default_selector{}); + TestQueue Queue1(sycl::host_selector{}); + TestQueue Queue2(sycl::host_selector{}); TestQueue Queue3(sycl::host_selector{}); std::vector Data(1); diff --git a/sycl/test/scheduler/HandleException.cpp b/sycl/test/scheduler/HandleException.cpp deleted file mode 100644 index 365a84ee9411..000000000000 --- a/sycl/test/scheduler/HandleException.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization -I %sycl_source_dir %s -o %t.out -// RUN: %CPU_RUN_PLACEHOLDER %t.out -#include -#include - -using namespace cl::sycl; - -constexpr access::mode sycl_read = access::mode::read; -constexpr access::mode sycl_write = access::mode::write; - -constexpr unsigned MAX_WG_SIZE = 4; -constexpr unsigned SIZE = 5; -using ArrayType = std::array; - -class kernelCompute; - -// Return 'true' if an exception was thrown. -bool run_kernel(const unsigned wg_size) { - ArrayType index; - const unsigned N = index.size(); - { - buffer bufferIdx(index.data(), N); - queue deviceQueue; - try { - deviceQueue.submit([&](handler &cgh) { - auto accessorIdx = bufferIdx.get_access(cgh); - cgh.parallel_for( - nd_range<1>(range<1>(N), range<1>(wg_size)), - [=](nd_item<1> ID) [[cl::reqd_work_group_size(1, 1, MAX_WG_SIZE)]] { - (void)accessorIdx[ID.get_global_id(0)]; - }); - }); - } catch (nd_range_error &err) { - return true; - } catch (...) { - assert(!"Unknown exception was thrown"); - } - } - return false; -} - -int main() { - bool success_exception = run_kernel(MAX_WG_SIZE); - assert(!success_exception && - "Unexpected exception was thrown for success call"); - bool fail_exception = run_kernel(SIZE); - assert(fail_exception && "No exception was thrown"); - - return 0; -} diff --git a/sycl/test/scheduler/HostAccDestruction.cpp b/sycl/test/scheduler/HostAccDestruction.cpp deleted file mode 100644 index 6b3fa8f107fe..000000000000 --- a/sycl/test/scheduler/HostAccDestruction.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// RUN: %clangxx -fsycl -fsycl-dead-args-optimization -I %sycl_source_dir %s -o %t.out -// RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER -//==---------------------- HostAccDestruction.cpp --------------------------==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -int main() { - size_t size = 3; - - cl::sycl::buffer buf(size); - { - cl::sycl::queue q; - auto host_acc = buf.get_access(); - q.submit([&](cl::sycl::handler &cgh) { - auto acc = buf.get_access(cgh); - cgh.parallel_for( - cl::sycl::range<1>{size}, - [=](cl::sycl::id<1> id) { (void)acc[id]; }); - }); - std::cout << "host acc destructor call" << std::endl; - } - std::cout << "end of scope" << std::endl; - - return 0; -} - -// CHECK:host acc destructor call -// CHECK:---> piEnqueueKernelLaunch( -// CHECK:end of scope diff --git a/sycl/test/scheduler/MemObjRemapping.cpp b/sycl/test/scheduler/MemObjRemapping.cpp deleted file mode 100644 index 04061f2a77e4..000000000000 --- a/sycl/test/scheduler/MemObjRemapping.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// RUN: %clangxx -fsycl %s -o %t.out -// RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER -#include -#include -#include - -using namespace cl::sycl; - -class Foo; -class Bar; - -// This test checks that memory objects are remapped on requesting an access mode -// incompatible with the current mapping. Write access is mapped as read-write. -int main() { - queue Q; - - std::size_t Size = 64; - range<1> Range{Size}; - buffer BufA{Range}; - buffer BufB{Range}; - - Q.submit([&](handler &Cgh) { - auto AccA = BufA.get_access(Cgh); - auto AccB = BufB.get_access(Cgh); - Cgh.parallel_for(Range, [=](id<1> Idx) { - AccA[Idx] = Idx[0]; - AccB[Idx] = Idx[0]; - }); - }); - - { - // Check access mode flags - // CHECK: piEnqueueMemBufferMap - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : 1 - // CHECK: piEnqueueMemBufferMap - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : 1 - auto AccA = BufA.get_access(); - auto AccB = BufB.get_access(); - for (std::size_t I = 0; I < Size; ++I) { - assert(AccA[I] == I); - assert(AccB[I] == I); - } - } - { - // CHECK: piEnqueueMemUnmap - // CHECK: piEnqueueMemBufferMap - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : 3 - auto AccA = BufA.get_access(); - for (std::size_t I = 0; I < Size; ++I) - AccA[I] = 2 * I; - } - - queue HostQ{host_selector()}; - // CHECK: piEnqueueMemUnmap - // CHECK: piEnqueueMemBufferMap - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : - // CHECK-NEXT: : 3 - HostQ.submit([&](handler &Cgh) { - auto AccB = BufB.get_access(Cgh); - Cgh.parallel_for(Range, [=](id<1> Idx) { - AccB[Idx] = 2 * Idx[0]; - }); - }); - - // CHECK-NOT: piEnqueueMemBufferMap - auto AccA = BufA.get_access(); - auto AccB = BufB.get_access(); - for (std::size_t I = 0; I < Size; ++I) { - assert(AccA[I] == 2 * I); - assert(AccB[I] == 2 * I); - } -} diff --git a/sycl/test/scheduler/MultipleDevices.cpp b/sycl/test/scheduler/MultipleDevices.cpp index 4f49c034ec64..aef48ab0197d 100644 --- a/sycl/test/scheduler/MultipleDevices.cpp +++ b/sycl/test/scheduler/MultipleDevices.cpp @@ -93,8 +93,6 @@ int multidevice_test(queue MyQueue1, queue MyQueue2) { int main() { host_selector hostSelector; - cpu_selector CPUSelector; - gpu_selector GPUSelector; int Result = -1; try { @@ -105,51 +103,5 @@ int main() { std::cout << "Skipping host and host" << std::endl; } - try { - queue MyQueue1(hostSelector); - queue MyQueue2(CPUSelector); - Result &= multidevice_test(MyQueue1, MyQueue2); - } catch(cl::sycl::runtime_error &) { - std::cout << "Skipping host and CPU" << std::endl; - } - - try { - queue MyQueue1(CPUSelector); - queue MyQueue2(CPUSelector); - Result &= multidevice_test(MyQueue1, MyQueue2); - } catch(cl::sycl::runtime_error &) { - std::cout << "Skipping CPU and CPU" << std::endl; - } - - try { - queue MyQueue1(CPUSelector); - queue MyQueue2(GPUSelector); - Result &= multidevice_test(MyQueue1, MyQueue2); - } catch(cl::sycl::runtime_error &) { - std::cout << "Skipping CPU and GPU" << std::endl; - } catch (cl::sycl::compile_program_error &) { - std::cout << "Skipping CPU and GPU" << std::endl; - } - - try { - queue MyQueue1(hostSelector); - queue MyQueue2(GPUSelector); - Result &= multidevice_test(MyQueue1, MyQueue2); - } catch(cl::sycl::runtime_error &) { - std::cout << "Skipping host and GPU" << std::endl; - } catch (cl::sycl::compile_program_error &) { - std::cout << "Skipping CPU and GPU" << std::endl; - } - - try { - queue MyQueue1(GPUSelector); - queue MyQueue2(GPUSelector); - Result &= multidevice_test(MyQueue1, MyQueue2); - } catch (cl::sycl::runtime_error &) { - std::cout << "Skipping GPU and GPU" << std::endl; - } catch (cl::sycl::compile_program_error &) { - std::cout << "Skipping CPU and GPU" << std::endl; - } - return Result; } diff --git a/sycl/test/scheduler/ReleaseResourcesTest.cpp b/sycl/test/scheduler/ReleaseResourcesTest.cpp index 0b8c6b12abfe..4824aaf8f985 100644 --- a/sycl/test/scheduler/ReleaseResourcesTest.cpp +++ b/sycl/test/scheduler/ReleaseResourcesTest.cpp @@ -1,8 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization -I %sycl_source_dir %s -o %t.out // RUN: env SYCL_DEVICE_TYPE=HOST %t.out -// RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER -// RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER -// RUN: env SYCL_PI_TRACE=2 %ACC_RUN_PLACEHOLDER %t.out 2>&1 %ACC_CHECK_PLACEHOLDER //==------------------- ReleaseResourcesTests.cpp --------------------------==// // @@ -48,12 +45,3 @@ int main() { return Failed; } - -// CHECK:---> piContextCreate -// CHECK:---> piQueueCreate -// CHECK:---> piProgramCreate -// CHECK:---> piKernelCreate -// CHECK:---> piQueueRelease -// CHECK:---> piContextRelease -// CHECK:---> piKernelRelease -// CHECK:---> piProgramRelease diff --git a/sycl/test/separate-compile/same-kernel.cpp b/sycl/test/separate-compile/same-kernel.cpp index ad72decfa360..cccd0b0a7f32 100644 --- a/sycl/test/separate-compile/same-kernel.cpp +++ b/sycl/test/separate-compile/same-kernel.cpp @@ -13,9 +13,6 @@ // // >> ---- link the full hetero app // RUN: %clangxx %t-same-kernel-a.o %t-same-kernel-b.o -o %t-same-kernel.exe -fsycl -fsycl-targets=%sycl_triple -// RUN: %CPU_RUN_PLACEHOLDER %t-same-kernel.exe -// RUN: %GPU_RUN_PLACEHOLDER %t-same-kernel.exe -// RUN: %ACC_RUN_PLACEHOLDER %t-same-kernel.exe #include diff --git a/sycl/test/separate-compile/sycl-external.cpp b/sycl/test/separate-compile/sycl-external.cpp index f2cdb1c43b24..a20b37b514e6 100644 --- a/sycl/test/separate-compile/sycl-external.cpp +++ b/sycl/test/separate-compile/sycl-external.cpp @@ -3,18 +3,12 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -DSOURCE1 -c %s -o %t1.o // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -DSOURCE2 -c %s -o %t2.o // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %t1.o %t2.o -o %t.exe -// RUN: %CPU_RUN_PLACEHOLDER %t.exe -// RUN: %GPU_RUN_PLACEHOLDER %t.exe -// RUN: %ACC_RUN_PLACEHOLDER %t.exe // // Test2 - check that kernel can call a SYCL_EXTERNAL function defined in a // static library. // RUN: rm -f %t.a // RUN: llvm-ar crv %t.a %t1.o // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %t2.o -foffload-static-lib=%t.a -o %t.exe -// RUN: %CPU_RUN_PLACEHOLDER %t.exe -// RUN: %GPU_RUN_PLACEHOLDER %t.exe -// RUN: %ACC_RUN_PLACEHOLDER %t.exe #include #include diff --git a/sycl/test/separate-compile/test.cpp b/sycl/test/separate-compile/test.cpp index 076de5fc0e9d..a97c7e4c8ae8 100644 --- a/sycl/test/separate-compile/test.cpp +++ b/sycl/test/separate-compile/test.cpp @@ -37,8 +37,6 @@ // // >> ---- link the full hetero app // RUN: %clangxx wrapper.o a.o b.o -o app.exe -lsycl -// RUN: env SYCL_BE=%sycl_be ./app.exe | FileCheck %s -// CHECK: pass //==----------- test.cpp - Tests SYCL separate compilation -----------------==// //