14
14
#include < CL/sycl.hpp>
15
15
#include < iostream>
16
16
#include < sycl/ext/intel/fpga_extensions.hpp>
17
+ #include < type_traits>
17
18
18
19
// Size of an array passing through a pipe
19
20
constexpr size_t N = 10 ;
@@ -32,6 +33,8 @@ template <int N> class templ_nb_pipe;
32
33
// For non-blocking multiple pipes
33
34
template <int N>
34
35
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 );
35
38
36
39
// For simple blocking pipes with explicit type
37
40
class some_bl_pipe ;
@@ -47,6 +50,8 @@ template <int N> class templ_bl_pipe;
47
50
// For blocking multiple pipes
48
51
template <int N>
49
52
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 );
50
55
51
56
// Kernel names
52
57
template <int TestNumber, int KernelNumber = 0 > class writer ;
@@ -58,6 +63,8 @@ int test_simple_nb_pipe(cl::sycl::queue Queue) {
58
63
int data[] = {0 };
59
64
60
65
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 );
61
68
62
69
cl::sycl::buffer<int , 1 > readBuf (data, 1 );
63
70
Queue.submit ([&](cl::sycl::handler &cgh) {
@@ -147,6 +154,8 @@ template <int TestNumber> int test_multiple_nb_pipe(cl::sycl::queue Queue) {
147
154
template <int TestNumber> int test_array_th_nb_pipe (cl::sycl::queue Queue) {
148
155
int data[N] = {0 };
149
156
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 );
150
159
151
160
Queue.submit ([&](cl::sycl::handler &cgh) {
152
161
cgh.single_task <class writer <TestNumber>>([=]() {
@@ -189,6 +198,8 @@ int test_simple_bl_pipe(cl::sycl::queue Queue) {
189
198
int data[] = {0 };
190
199
191
200
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 );
192
203
193
204
cl::sycl::buffer<int , 1 > readBuf (data, 1 );
194
205
Queue.submit ([&](cl::sycl::handler &cgh) {
@@ -257,6 +268,8 @@ template <int TestNumber> int test_multiple_bl_pipe(cl::sycl::queue Queue) {
257
268
template <int TestNumber> int test_array_th_bl_pipe (cl::sycl::queue Queue) {
258
269
int data[N] = {0 };
259
270
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 );
260
273
261
274
Queue.submit ([&](cl::sycl::handler &cgh) {
262
275
cgh.single_task <class writer <TestNumber>>([=]() {
0 commit comments