Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (28 sloc) 0.854 kb
export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
#if !defined(ISPC_TARGET_AVX11) && !defined(ISPC_TARGET_AVX2)
RET[programIndex] = 0;
#else
uniform int set[64] = { 0 };
uniform int count = 1024*1024;
for (uniform int i = 0; i < count; ++i) {
uniform int64 r;
while (!rdrand(&r))
;
for (uniform int b = 0; b < 64; ++b)
if (((unsigned int64)r >> b) & 1)
++set[b];
}
RET[programIndex] = 0;
for (uniform int b = 0; b < 64; ++b) {
float r = (double)set[b] / (double)(count);
if (!(r >= .49 && r < .51)) {
print("% % - %\n", b, r, set[b]);
++RET[programIndex];
}
}
#endif
}
export void result(uniform float RET[]) {
RET[programIndex] = 0;
}
Jump to Line
Something went wrong with that request. Please try again.