Knowledge Base Article

Why does a stack dump occur during an OpenCL™ kernel compile if the loop count exceeds the number of channels allocated?

Description

A stack dump may occur during an OpenCL™ compile if a loop contains a write to an indexed channel and the loop count exceeds the number of channels allocated.  See the example code below.

channel unsigned char  my_channel[16] __attribute__((depth(1024)));
char data[32];

...
    for (unsigned char i = 0; i < 32; i ) {
        write_channel_intel(my_channel[i], data[i]);

    }

  

Resolution

Be sure that the loop count never exceeds the number of channels allocated.

#define num_channels 32

channel unsigned char  my_channel[num_channels] __attribute__((depth(1024)));
char data[num_channels];

...
    for (unsigned char i = 0; i < num_channels; i ) {
        write_channel_intel(my_channel[i], data[i]);

    }

This problem is fixed beginning with version 19.1 of the Intel® FPGA SDK for OpenCL™ compiler.

Updated 5 days ago
Version 3.0
No CommentsBe the first to comment