cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

MELO_AX
Journeyman III

How work the kernel??

 

 

 

 

 

 

 

 

 

 

 

kernel

void check_eps(float a[][], float eps, float size, out float result<>{

 



 

float2 index = float2 (0.0f, 0.0f);

 

 

float2 step = float2 (0.0f, 1.0f);

 

 

float2 index2 = index+step;

 

 

float i = 1.0f;

 

 

float accumulator = 0.0f;

 

 

 

 

while (i<size){

 

 

if ((a[index.xy] - a[index2.xy]) <= eps){ accumulator = accumulator + 1.0f;}

 

else{accumulator = accumulator + 0.0f;}

i = i+1; index = index2; index2 = index2 + step;

}

result = accumulator;

}

Sometimes result is 1 but the differenz of each elements of the rows is not smaler than eps!!!! Why!!?!?!

 





0 Likes
0 Replies