Forum Discussion
Altera_Forum
Honored Contributor
8 years agoLatency of the loop
Would the latency of the below loop be different for switch_loop = 0 and switch_loop =1? The html report generated for the below kernel includes the latency of the global and local memory access. ...
Altera_Forum
Honored Contributor
8 years ago[QUOTE=HRZ;239754
This should also be somewhere in their OpenCL documentation but I didn't find it. . --- Quote End --- Not much is mentioned about conditional execution but some information is there in Best practices guide Pg 162, chapter 9. Strategies for Optimizing Intel Stratix® 10 OpenCL Designs. But do you think the Kernel 2 with logic replication would give different latency. __kernel __attribute__((task)) void dummy_kernel ( uchar switch_loop, __global float *restrict bottom , __local float *restrict top, __global float *restrict final ) { float privatee; if (switch_loop == 0) { for (unsigned i = 0; i< 20; i++) { privatee = bottom;
final = privatee; } } else { for (unsigned i = 0; i< 20; i++) { privatee = top;
final = privatee; } } }