Skip to content

Commit 2dda512

Browse files
tyoungscbb-sycl
authored andcommitted
[SYCL] [FPGA] Modifying fpga_pipes emulator test (intel#800)
* Fixing FPGA pipes tests with changes to pipes header
1 parent e98749b commit 2dda512

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

SYCL/Basic/fpga_tests/fpga_pipes.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <CL/sycl.hpp>
1515
#include <iostream>
1616
#include <sycl/ext/intel/fpga_extensions.hpp>
17+
#include <type_traits>
1718

1819
// Size of an array passing through a pipe
1920
constexpr size_t N = 10;
@@ -32,6 +33,8 @@ template <int N> class templ_nb_pipe;
3233
// For non-blocking multiple pipes
3334
template <int N>
3435
using PipeMulNb = cl::sycl::ext::intel::pipe<class templ_nb_pipe<N>, int>;
36+
static_assert(std::is_same_v<typename PipeMulNb<0>::value_type, int>);
37+
static_assert(PipeMulNb<0>::min_capacity == 0);
3538

3639
// For simple blocking pipes with explicit type
3740
class some_bl_pipe;
@@ -47,6 +50,8 @@ template <int N> class templ_bl_pipe;
4750
// For blocking multiple pipes
4851
template <int N>
4952
using PipeMulBl = cl::sycl::ext::intel::pipe<class templ_bl_pipe<N>, int>;
53+
static_assert(std::is_same_v<typename PipeMulBl<0>::value_type, int>);
54+
static_assert(PipeMulBl<0>::min_capacity == 0);
5055

5156
// Kernel names
5257
template <int TestNumber, int KernelNumber = 0> class writer;
@@ -58,6 +63,8 @@ int test_simple_nb_pipe(cl::sycl::queue Queue) {
5863
int data[] = {0};
5964

6065
using Pipe = cl::sycl::ext::intel::pipe<PipeName, int>;
66+
static_assert(std::is_same_v<typename Pipe::value_type, int>);
67+
static_assert(Pipe::min_capacity == 0);
6168

6269
cl::sycl::buffer<int, 1> readBuf(data, 1);
6370
Queue.submit([&](cl::sycl::handler &cgh) {
@@ -147,6 +154,8 @@ template <int TestNumber> int test_multiple_nb_pipe(cl::sycl::queue Queue) {
147154
template <int TestNumber> int test_array_th_nb_pipe(cl::sycl::queue Queue) {
148155
int data[N] = {0};
149156
using AnotherNbPipe = cl::sycl::ext::intel::pipe<class another_nb_pipe, int>;
157+
static_assert(std::is_same_v<typename AnotherNbPipe::value_type, int>);
158+
static_assert(AnotherNbPipe::min_capacity == 0);
150159

151160
Queue.submit([&](cl::sycl::handler &cgh) {
152161
cgh.single_task<class writer<TestNumber>>([=]() {
@@ -189,6 +198,8 @@ int test_simple_bl_pipe(cl::sycl::queue Queue) {
189198
int data[] = {0};
190199

191200
using Pipe = cl::sycl::ext::intel::pipe<PipeName, int>;
201+
static_assert(std::is_same_v<typename Pipe::value_type, int>);
202+
static_assert(Pipe::min_capacity == 0);
192203

193204
cl::sycl::buffer<int, 1> readBuf(data, 1);
194205
Queue.submit([&](cl::sycl::handler &cgh) {
@@ -257,6 +268,8 @@ template <int TestNumber> int test_multiple_bl_pipe(cl::sycl::queue Queue) {
257268
template <int TestNumber> int test_array_th_bl_pipe(cl::sycl::queue Queue) {
258269
int data[N] = {0};
259270
using AnotherBlPipe = cl::sycl::ext::intel::pipe<class another_bl_pipe, int>;
271+
static_assert(std::is_same_v<typename AnotherBlPipe::value_type, int>);
272+
static_assert(AnotherBlPipe::min_capacity == 0);
260273

261274
Queue.submit([&](cl::sycl::handler &cgh) {
262275
cgh.single_task<class writer<TestNumber>>([=]() {

0 commit comments

Comments
 (0)