Article ID: 000073934 Content Type: Troubleshooting Last Reviewed: 12/06/2024

Why does the FPGA SDK for OpenCL™ compiler hang and never terminate with NDRange kernels that contain thread-dependent control flow or channel operations?

Environment

  • Intel® Quartus® Prime Pro Edition
  • Intel® FPGA SDK for OpenCL™ Pro Edition
  • BUILT IN - ARTICLE INTRO SECOND COMPONENT
    Description

    The FPGA SDK for OpenCL™ compiler provides a guarantee that statements in an NDRange kernel are executed by threads in order of their thread-identifiers. To ensure the guarantee is met in programs that contain thread-dependent control-flow, a re-ordering barrier is inserted by the compiler at the join point of thread-dependent control-flow paths. A fault in the configuration of such barriers causes computation to stall at the barrier without possibility of forward progress. 

    Channel operations can also cause this stall.

    Shown below is an example of a “thread-dependent control-flow construct”:

       
    //Get global thread ID    

    int id = get_global_id(0); 

    //Make sure we do not go out of bounds

    if (id < n)    

    c[id] = a[id] b[id]; 

     

    Here, the if statement is a control-flow construct that is thread-dependent, i.e. what it does depends on which thread executes it.

    Resolution

    Re-write the NDRange kernel to not contain any channel operations or thread-dependent control-flow constructs.

     

    Related Products

    This article applies to 1 products

    Intel® Programmable Devices