Fuxianjun

a finding of loop in kernel

Discussion created by Fuxianjun on Aug 12, 2010
Latest reply on Aug 12, 2010 by Marco13

this two kernels' execution times are almost the same,both of them take between 8 to 11 ms. why ?

__kernel void testone(__global float * a, __global float * b, __global float * c) { int i = get_global_id(0); for(int j=0;j<10000000;j++) { c[i]+=a[i]*b[i]+j; } } __kernel void testtwo(__global float * a, __global float * b, __global float * c) { int i = get_global_id(0); for(int j=0;j<10;j++) { c[i]+=a[i]*b[i]+j; } }

Outcomes