Altera_Forum
Honored Contributor
7 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.
Eg: If global memory access takes 5 cycles then the start cycle of local memory access is 6 and hence the start cycle of additon operation is 9 (3cycles of local memory access). Doesnt the latency of the loop depend on the if condition based on kernel argument by host? __kernel __attribute__((task)) void dummy_kernel ( __global *restrict bottom , __local *restrict top, __global *restrict final, uchar switch_loop) { float private; for (unsigned i = 0; i< 20; i++) { if (switch_loop == 0) private = global_memory;else
private = local_memory; private = private + 1; final[i] = private; } }