Hi Ric,
Sorry this took so long. I think the root of the problem we encountered with all of our workaround that uses pthread is that multithreading isn't fully supported in FPGA flow with oneAPI as it is mention in this release note.
I would suggest performing pipe read and write in the same loop:
q.single_task<Threshold>(ThresholdKernel{});
// Check that output pixels are below the threshold
bool passed = true;
for (int i = 0; i < (width * height); ++i) {
// Write to input pipe
bool start_of_packet = (i == 0);
bool end_of_packet = (i == ((width * height) - 1));
StreamingBeatT in_beat(i, start_of_packet, end_of_packet);
InPixelPipe::write(q, in_beat);
if(i%1000 == 0)
std::cerr << "Input: " << i << "\t " << (width * height) << std::endl;
// Read from output pipe
StreamingBeatT out_beat = OutPixelPipe::read(q);
passed &= (out_beat.data <= kThreshold);
if(i%1000 == 0)
std::cerr << "Output: " << i << "\t " << out_beat.data << std::endl;
}
Let me know if this could work for you,
Thanks,