OpenCL: internal implementation tests in MQL5 - page 45

 
MetaDriver:
.........
"      out[i]=0;         \r\n" // после десятитысячного шага итерации этот оператор начнёт выполняться в каждом цикле.
"   }                    \r\n" // т.е. на выходе из цикла по любому будем иметь out[i] = 0;
......... 
Why?
 
joo:
Why?
out[i]+=u;       // если к неотрицательному числу прибавить число u большее 10000
if(out[i]>10000)  // то результат будет больше 10000 (true)
  out[i]=0;      // тогда ... = 0
 

И?...

I can't keep up with your thinking, I'm sorry.

 
joo:

И?...

И... then...

"      out[i]=0;         \r\n" // после десятитысячного шага итерации этот оператор начнёт выполняться в каждом цикле.
"   }                    \r\n" // т.е. на выходе из цикла по любому будем иметь out[i] = 0;
 

Andrey, it's simple: out[ i ] cannot be higher than 10000, and as soon as it is higher, the array value is zeroed - by convention. Starting from u=10001, it will always be zeroed.

From here on, we will start adding even larger values of u to zero. But not too big, no more than 4 billion for sure. Hence, the value of the array is positive and exactly greater than 10000. Therefore, it is zero again. And so on. And then, outside the loop, we add i to zero.

 

This is understandable. What's not clear is why my Out[] array will contain the same thing as Vladimir's array:

"__kernel void MFractal(                                    \r\n"
"                       __global int *out                   \r\n"
"                      )                                    \r\n"
"  {                                                        \r\n"
"   out[get_global_id(0)]= get_global_id(0);                \r\n"
"  }                                                        \r\n";
 
joo: It's clear. What's not clear is why my array Out[] will contain the same value as Vladimir's array:

Because outside the loop, when the array value is already zero, i = get_global_id(0) is added to it.

Well go ahead and print out all the values.

 
I've almost got the sli of the 590 together when's the next test?
 
casinonsk:
I've almost got the sli of the 590 together, when's the next test?
Now it's your turn to write something. )
 
casinonsk:
I've almost got the sli of the 590 together when is the next test going to take place?
Run the early tests on this sli of yours and post it here. Some fun at least...