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 agoReplicating the logic results in below kernel. Would the latency of the kernel depend on the conditional statement in this case?
__kernel __attribute__((task)) void dummy_kernel ( __global *restrict bottom , __local *restrict top, __global *restrict final, uchar switch_loop) { float private; if (switch_loop == 0) { for (unsigned i = 0; i< 20; i++) { private = global_memory;
final = private; } } else { for (unsigned i = 0; i< 20; i++) { private = local_memory;
final = private; } } }