Files
ispc/tests/foreach-32.ispc
2016-04-12 00:29:17 +03:00

30 lines
780 B
Plaintext

export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
#define A_BEGIN 11
#define A_END 14
#define B_BEGIN 28
#define B_END 31
#define C_BEGIN 0
#define C_END 8
uniform int t = 0;
foreach_tiled (i = A_BEGIN ... A_END, j = B_BEGIN ... B_END, k = C_BEGIN ... C_END) {
t++;
}
//the comparison with the expected number of iterations
if (programCount == 4)
RET[programIndex] = t - 24;
else if (programCount == 8)
RET[programIndex] = t - 16;
else if (programCount == 16)
RET[programIndex] = t - 8;
else
RET[programIndex] = t; //this case is still unknown, error in general
}
export void result(uniform float RET[]) {
RET[programIndex] = 0;
}