Passing PipeArray as template in functor
Hi, I am trying to pass pipeArray through template in a functor.
The pipeArray code in the following oneAPI sample directory was used:
oneAPI-samples/DirectProgramming/C++SYCL_FPGA/include/pipe_utils.hpp
The pipe array definition:
// pipe array using testPipeArray = fpga_tools::PipeArray<class testPipeArrayId, Data_t, kDepth, kWidth>;
Functor code:
template <typename inPipe> class tileReadData{ public: Data_t *inMatPtr; unsigned total_reads; unsigned mem_base_addr; void operator()() const{ Data_t * inMatLocated(inMatPtr); [[intel::initiation_interval(1)]] for (unsigned mem_idx = 0; mem_idx < total_reads; mem_idx++) { fpga_tools::UnrolledLoop<kWidth>([&](auto jdx) { inPipe::PipeAt<jdx>::write(inMatLocated[mem_base_addr + mem_idx * kWidth + jdx]); }); } } };
Used in code:
// data read auto tileReadData_event = q.single_task<tileReadDataId>( tileReadData<testPipeArray>{inMat, total_reads, mem_base_addr});
This code makes the following error messages:
error: no member named 'write' in the global namespace; did you mean 'fwrite'?
50 | inPipe::pipeAt<jdx>::write(inMatLocated[mem_base_addr + mem_idx * kWidth + jdx]);
error: use of alias template 'PipeAt' requires template arguments
error: SYCL kernel cannot call an undefined function without SYCL_EXTERNAL attribute
These error message does not come up when using pipe instead of pipearray (also without the unrolled loop). Is there a way that I can pass pipeArray in functor through template?
Thanks