diff --git a/sycl/test-e2e/TaskSequence/common.hpp b/sycl/test-e2e/TaskSequence/common.hpp deleted file mode 100644 index a93f38816ad99..0000000000000 --- a/sycl/test-e2e/TaskSequence/common.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include "sycl/detail/builtins/builtins.hpp" -#include -#include -#include -#include -#include - -using namespace sycl; -using namespace sycl::ext::oneapi::experimental; -using namespace sycl::ext::intel::experimental; diff --git a/sycl/test-e2e/TaskSequence/concurrent-loops.cpp b/sycl/test-e2e/TaskSequence/concurrent-loops.cpp deleted file mode 100644 index 457a0ebaed26d..0000000000000 --- a/sycl/test-e2e/TaskSequence/concurrent-loops.cpp +++ /dev/null @@ -1,97 +0,0 @@ -//==-------------- concurrent-loops.cpp - DPC++ task_sequence --------------==// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// FIXME: failure in post-commit, re-enable when fixed: -// UNSUPPORTED: linux - -// REQUIRES: aspect-ext_intel_fpga_task_sequence -// RUN: %clangxx -fsycl -fintelfpga %s -o %t.out -// RUN: %{run} %t.out - -#include "common.hpp" - -constexpr int kPrecision = 20; -constexpr double kX = 0.9; -constexpr double kA = 2.5; -constexpr double kB = 3.7; - -using intertask_pipe = pipe; - -template double task_a(double x, double a, int precision) { - double res = 1; - double term = 1; - double multiplier = a; - - // compute the non-constant common term of the Maclaurin series of exp(x) - // feed reuseable result through intertask pipe - // compute remaining terms of Maclaurin series of exp(ax) and accummulate - for (int iter = 1; iter <= precision; ++iter) { - term *= x / iter; - // reuse the shared value for both exponential series - OutPipe::write(term); - res += term * multiplier; - multiplier *= a; - } - - return res; -} - -template double task_b(double b, int precision) { - double res = 1; - double multiplier = b; - - // reuse the non-constant common term from task_a - for (int iter = 1; iter <= precision; ++iter) { - // compute terms of Maclaurin series of exp(bx) and accumulate - res += InPipe::read() * multiplier; - multiplier *= b; - } - - return res; -}; - -class ConcurrentLoop; - -int main() { - - double golden = exp(kA * kX) / exp(kB * kX); - - // initialize inputs - std::vector in = {kX, kA, kB}; - std::vector out = {0.0}; - - { - sycl::queue q; - - buffer in_buf(in); - buffer out_buf(out); - - q.submit([&](handler &h) { - accessor in_acc(in_buf, h, read_only); - accessor out_acc(out_buf, h, write_only); - h.single_task([=]() { - task_sequence> ts_a; - task_sequence> ts_b; - - double x = in_acc[0]; - double a = in_acc[1]; - double b = in_acc[2]; - - // approximate e^(ax)/e^(bx) using Maclaurin series - ts_a.async(x, a, kPrecision); - ts_b.async(b, kPrecision); - - out_acc[0] = ts_a.get() / ts_b.get(); - }); - }); - q.wait(); - } - - assert(abs(out[0] - golden) < 0.001); - return 0; -} diff --git a/sycl/test-e2e/TaskSequence/in-order-async-get.cpp b/sycl/test-e2e/TaskSequence/in-order-async-get.cpp deleted file mode 100644 index 0f1b99debfa5e..0000000000000 --- a/sycl/test-e2e/TaskSequence/in-order-async-get.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//==------------- in-order-async-get.cpp - DPC++ task_sequence -------------==// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// FIXME: failure in post-commit, re-enable when fixed: -// UNSUPPORTED: linux - -// REQUIRES: aspect-ext_intel_fpga_task_sequence -// RUN: %clangxx -fsycl -fintelfpga %s -o %t.out -// RUN: %{run} %t.out - -#include "common.hpp" - -constexpr int kNumInputs = 16; - -class InOrderTasks; - -// task that computes the sigmoid function -double sigmoid(double in) { - double Ex = exp(in); - return (Ex / (Ex + 1)); -} - -int main() { - std::vector values(kNumInputs); - std::vector golden(kNumInputs); - std::vector results(kNumInputs, 0); - - // test data - for (int i = 0; i < kNumInputs; ++i) { - values[i] = (static_cast(-kNumInputs / 2.0 + i) / 1000); - golden[i] = 1 / (1 + exp(-values[i])); - } - - { - queue q; - - buffer values_buf(values); - buffer results_buf(results); - - q.submit([&](handler &h) { - accessor values_acc(values_buf, h, read_only); - accessor results_acc(results_buf, h, write_only); - h.single_task([=]() { - task_sequence})> - ts; - - for (int i = 0; i < kNumInputs; ++i) { - ts.async(values_acc[i]); - } - - // multiple async calls before first get call - for (int i = 0; i < kNumInputs; ++i) { - results_acc[i] = ts.get(); - } - }); - }); - q.wait(); - } - - // verification - for (int i = 0; i < kNumInputs; ++i) { - assert(abs(results[i] - golden[i]) < 0.001); - } - - return 0; -} diff --git a/sycl/test-e2e/TaskSequence/mult-and-add.cpp b/sycl/test-e2e/TaskSequence/mult-and-add.cpp deleted file mode 100644 index c0c0acd484b64..0000000000000 --- a/sycl/test-e2e/TaskSequence/mult-and-add.cpp +++ /dev/null @@ -1,44 +0,0 @@ -//==---------------- mult-and-add.cpp - DPC++ task_sequence ----------------==// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// FIXME: failure in post-commit, re-enable when fixed: -// UNSUPPORTED: linux - -// REQUIRES: aspect-ext_intel_fpga_task_sequence -// RUN: %clangxx -fsycl -fintelfpga %s -o %t.out -// RUN: %{run} %t.out - -#include "common.hpp" - -int mult(int a, int b) { return a * b; } - -int mult_and_add(int a1, int b1, int a2, int b2) { - task_sequence, - response_capacity<1>})> - task1, task2; - - task1.async(a1, b1); - task2.async(a2, b2); - return task1.get() + task2.get(); -} - -int main() { - queue myQueue; - - int result = 0; - buffer res_buf(&result, range<1>(1)); - - myQueue.submit([&](handler &cgh) { - auto res_acc = res_buf.get_access(cgh); - cgh.single_task( - [=](kernel_handler kh) { res_acc[0] = mult_and_add(1, 2, 3, 4); }); - }); - myQueue.wait(); - - assert(result == (1 * 2 + 3 * 4)); -} diff --git a/sycl/test-e2e/TaskSequence/multi-kernel-task-function-reuse.cpp b/sycl/test-e2e/TaskSequence/multi-kernel-task-function-reuse.cpp deleted file mode 100644 index 98aebb6aab057..0000000000000 --- a/sycl/test-e2e/TaskSequence/multi-kernel-task-function-reuse.cpp +++ /dev/null @@ -1,83 +0,0 @@ -//==------ multi-kernel-task-function-reuse.cpp - DPC++ task_sequence ------==// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// FIXME: failure in post-commit, re-enable when fixed: -// UNSUPPORTED: linux - -// REQUIRES: aspect-ext_intel_fpga_task_sequence -// RUN: %clangxx -fsycl -fintelfpga %s -o %t.out -// RUN: %{run} %t.out - -#include "common.hpp" - -constexpr int kCount = 1024; - -int vectorSum(const int *v, size_t s, size_t sz) { - int result = 0; - for (size_t i = s; i < s + sz; i++) { - result += v[i]; - } - - return result; -} - -// Kernel identifiers -class SequentialTask; -class ParallelTask; - -int main() { - queue q; - - // create input and golden output data - std::vector in(kCount), out(2); - for (int i = 0; i < kCount; i++) { - in[i] = i; - } - - int golden = vectorSum(in.data(), 0, kCount); - - { - buffer in_buf(in); - buffer out_buf(out); - - q.submit([&](handler &h) { - accessor in_acc(in_buf, h, read_only); - accessor out_acc(out_buf, h, write_only); - h.single_task([=]() { - task_sequence whole; - whole.async(in_acc.get_pointer(), 0, kCount); - out_acc[0] = whole.get(); - }); - }); - - q.submit([&](sycl::handler &h) { - accessor in_acc(in_buf, h, read_only); - accessor out_acc(out_buf, h, write_only); - h.single_task([=]() { - task_sequence firstQuarter; - task_sequence secondQuarter; - task_sequence thirdQuarter; - task_sequence fourthQuarter; - constexpr int quarterCount = kCount / 4; - firstQuarter.async(in_acc.get_pointer(), 0, quarterCount); - secondQuarter.async(in_acc.get_pointer(), quarterCount, quarterCount); - thirdQuarter.async(in_acc.get_pointer(), 2 * quarterCount, - quarterCount); - fourthQuarter.async(in_acc.get_pointer(), 3 * quarterCount, - quarterCount); - out_acc[1] = firstQuarter.get() + secondQuarter.get() + - thirdQuarter.get() + fourthQuarter.get(); - }); - }); - q.wait(); - } - - assert(out[0] == golden); - assert(out[1] == golden); - return 0; -} diff --git a/sycl/test-e2e/TaskSequence/producer-consumer.cpp b/sycl/test-e2e/TaskSequence/producer-consumer.cpp deleted file mode 100644 index 2a9b5a8f153c3..0000000000000 --- a/sycl/test-e2e/TaskSequence/producer-consumer.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//==-------------- producer-consumer.cpp - DPC++ task_sequence -------------==// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// FIXME: failure in post-commit, re-enable when fixed: -// UNSUPPORTED: linux - -// REQUIRES: aspect-ext_intel_fpga_task_sequence -// RUN: %clangxx -fsycl -fintelfpga %s -o %t.out -// RUN: %{run} %t.out - -#include "common.hpp" - -constexpr int kSize = 128; - -using intertask_pipe = pipe; - -template void producer(int *a, int *b, int N) { - for (int i = 0; i < N; ++i) { - OutPipe::write(a[i] * b[i]); - } -} - -template int consumer(int N) { - int total = 0; - for (int i = 0; i < N; ++i) { - total += (InPipe::read() + 42); - } - return total; -} - -int main() { - queue myQueue; - - int result = 0; - buffer res_buf(&result, range<1>(1)); - - myQueue.submit([&](handler &cgh) { - auto res_acc = res_buf.get_access(cgh); - cgh.single_task([=](kernel_handler kh) { - int d1[kSize], d2[kSize]; - for (int i = 0; i < kSize; ++i) - d1[i] = d2[i] = i; - task_sequence> producerTask; - task_sequence> consumerTask; - - producerTask.async(d1, d2, kSize); - consumerTask.async(kSize); - res_acc[0] = consumerTask.get(); - }); - }); - myQueue.wait(); - - // Check result: - int sum = 0; - for (int i = 0; i < kSize; ++i) - sum += i * i + 42; - assert(result == sum); - return 0; -} diff --git a/sycl/test-e2e/TaskSequence/struct-array-args-and-return.cpp b/sycl/test-e2e/TaskSequence/struct-array-args-and-return.cpp deleted file mode 100644 index 794fcdd8d360d..0000000000000 --- a/sycl/test-e2e/TaskSequence/struct-array-args-and-return.cpp +++ /dev/null @@ -1,118 +0,0 @@ -//==-------- struct-array-args-and-return.cpp - DPC++ task_sequence --------==// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// FIXME: failure in post-commit, re-enable when fixed: -// UNSUPPORTED: linux - -// REQUIRES: aspect-ext_intel_fpga_task_sequence -// RUN: %clangxx -fsycl -fintelfpga %s -o %t.out -// RUN: %{run} %t.out -#include "common.hpp" - -class TaskSequenceTest; - -template class FixedVect { - T data[COUNT]; - -public: - T &operator[](int i) { return data[i]; } -}; - -struct DataStruct { - float val; - bool isValid; - - DataStruct() : val(-1.0f), isValid(false) {} - DataStruct(float val_, bool isValid_) : val(val_), isValid(isValid_) {} -}; - -using DataArray = FixedVect; -using intertask_pipe1 = pipe; -using intertask_pipe2 = pipe; - -template void argStruct(DataStruct data) { - if (data.isValid) { - OutPipe::write(data.val * data.val); - } -} - -template void argArray(DataArray data) { - for (int i = 0; i < 2; i++) { - float a = data[i]; - OutPipe::write(a * a); - } -} - -template DataStruct returnStruct() { - float a = InPipe::read(); - DataStruct res{sqrt(a), true}; - return res; -} - -template DataArray returnArray() { - DataArray res; - for (int i = 0; i < 2; i++) { - float a = InPipe::read(); - res[i] = sqrt(a); - } - - return res; -} - -int main() { - std::vector vec_in_struct(1); - std::vector vec_in_array(1); - std::vector res_struct(1); - std::vector res_array(1); - - vec_in_struct[0] = DataStruct{5.0, true}; - - DataArray d; - d[0] = 7.0; - d[1] = 9.0; - vec_in_array[0] = d; - - { - queue q; - - buffer buffer_in_struct(vec_in_struct); - buffer buffer_in_array(vec_in_array); - buffer buffer_out_struct(res_struct); - buffer buffer_out_array(res_array); - - q.submit([&](handler &h) { - accessor in_acc_struct(buffer_in_struct, h, read_only); - accessor in_acc_array(buffer_in_array, h, read_only); - accessor out_acc_struct(buffer_out_struct, h, write_only, no_init); - accessor out_acc_array(buffer_out_array, h, write_only, no_init); - h.single_task([=]() { - task_sequence> ts_func1Struct; - task_sequence> ts_func1Array; - task_sequence> ts_func2Struct; - task_sequence> ts_func2Array; - - // launch struct task functions - ts_func1Struct.async(in_acc_struct[0]); - ts_func2Struct.async(); - - // launch array task functions - ts_func1Array.async(in_acc_array[0]); - ts_func2Array.async(); - - out_acc_struct[0] = ts_func2Struct.get(); - out_acc_array[0] = ts_func2Array.get(); - }); - }); - q.wait(); - } - assert((abs(res_struct[0].val - vec_in_struct[0].val) < 0.001) && - res_struct[0].isValid); - assert((abs(res_array[0][0] - vec_in_array[0][0]) < 0.001) && - (abs(res_array[0][1] - vec_in_array[0][1]) < 0.001)); - return 0; -}