Fix more tests for 32 and 64-wide execution.
This commit is contained in:
@@ -5,7 +5,8 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
|
|||||||
uniform float * uniform buf = uniform new uniform float[32*32];
|
uniform float * uniform buf = uniform new uniform float[32*32];
|
||||||
for (uniform int i = 0; i < 32*32; ++i)
|
for (uniform int i = 0; i < 32*32; ++i)
|
||||||
buf[i] = i;
|
buf[i] = i;
|
||||||
|
|
||||||
|
assert(programIndex <= 64);
|
||||||
RET[programIndex] = buf[64-programIndex];
|
RET[programIndex] = buf[64-programIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ export uniform int width() { return programCount; }
|
|||||||
|
|
||||||
|
|
||||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||||
int32 i = (1 << programIndex);
|
int32 i = (1 << (programIndex % 28));
|
||||||
RET[programIndex] = count_leading_zeros(i);
|
RET[programIndex] = count_leading_zeros(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
export void result(uniform float RET[]) {
|
export void result(uniform float RET[]) {
|
||||||
RET[programIndex] = 31-programIndex;
|
RET[programIndex] = 31-(programIndex%28);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ export uniform int width() { return programCount; }
|
|||||||
|
|
||||||
|
|
||||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||||
unsigned int64 i = ((unsigned int64)1 << (40+programIndex));
|
unsigned int64 i = ((unsigned int64)1 << min(63, 40+programIndex));
|
||||||
RET[programIndex] = count_trailing_zeros(i);
|
RET[programIndex] = count_trailing_zeros(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
export void result(uniform float RET[]) {
|
export void result(uniform float RET[]) {
|
||||||
RET[programIndex] = 40+programIndex;
|
RET[programIndex] = min(63, 40+programIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export uniform int width() { return programCount; }
|
|||||||
|
|
||||||
|
|
||||||
bool ok(float x, float ref) {
|
bool ok(float x, float ref) {
|
||||||
bool r = (abs(x - ref) < 1e-6) || abs((x-ref)/ref) < 1e-5;
|
bool r = (abs(x - ref) < 1e-4) || abs((x-ref)/ref) < 1e-4;
|
||||||
if (any(r == false))
|
if (any(r == false))
|
||||||
print("mismatch got %, expected %\n", x, ref);
|
print("mismatch got %, expected %\n", x, ref);
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export uniform int width() { return programCount; }
|
|||||||
|
|
||||||
|
|
||||||
bool ok(float x, float ref) {
|
bool ok(float x, float ref) {
|
||||||
bool r = (abs(x - ref) < 1e-6) || abs((x-ref)/ref) < 1e-5;
|
bool r = (abs(x - ref) < 1e-5) || abs((x-ref)/ref) < 1e-5;
|
||||||
if (any(r == false))
|
if (any(r == false))
|
||||||
print("mismatch got %, expected %\n", x, ref);
|
print("mismatch got %, expected %\n", x, ref);
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
@@ -8,12 +8,13 @@ struct Foo {
|
|||||||
};
|
};
|
||||||
export void f_fi(uniform float RET[], uniform float a[], uniform int bFOO[]) {
|
export void f_fi(uniform float RET[], uniform float a[], uniform int bFOO[]) {
|
||||||
int b = bFOO[programIndex];
|
int b = bFOO[programIndex];
|
||||||
uniform struct Foo myFoo[17];
|
uniform struct Foo myFoo[256];
|
||||||
uniform int i;
|
uniform int i;
|
||||||
for (i = 0; i < 17; ++i) {
|
for (i = 0; i < 256; ++i) {
|
||||||
myFoo[i].x = i;
|
myFoo[i].x = i;
|
||||||
myFoo[i].f = 17+2*i;
|
myFoo[i].f = 17+2*i;
|
||||||
}
|
}
|
||||||
|
assert(b/2 < 256);
|
||||||
RET[programIndex] = myFoo[b/2].f;
|
RET[programIndex] = myFoo[b/2].f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user