Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update run_tests and examples makefile for scalar target.

Fixed a number of tests that didn't handle the programCount == 1
case correctly.
  • Loading branch information...
commit 0575b1f38de68e69ea4dfa44e5a174edd8f3db13 1 parent f6cd01f
Matt Pharr authored
Showing with 168 additions and 107 deletions.
  1. +7 −1 examples/common.mk
  2. +3 −2 run_tests.py
  3. +3 −1 tests/array-gather-multi-unif.ispc
  4. +4 −4 tests/array-pointer-duality-1.ispc
  5. +1 −1  tests/array-scatter-unif-2.ispc
  6. +3 −1 tests/array-scatter-unif.ispc
  7. +1 −1  tests/atomics-10.ispc
  8. +1 −1  tests/atomics-13.ispc
  9. +1 −1  tests/atomics-6.ispc
  10. +1 −1  tests/atomics-8.ispc
  11. +1 −1  tests/atomics-9.ispc
  12. +1 −1  tests/broadcast-1.ispc
  13. +1 −1  tests/broadcast-2.ispc
  14. +1 −1  tests/broadcast-3.ispc
  15. +1 −1  tests/broadcast.ispc
  16. +2 −2 tests/extract-1.ispc
  17. +1 −1  tests/packed-load-3.ispc
  18. +7 −3 tests/packed-load-5.ispc
  19. +1 −1  tests/packed-store-3.ispc
  20. +1 −1  tests/popcnt-3.ispc
  21. +4 −2 tests/ptr-assign-lhs-math-1.ispc
  22. +3 −2 tests/reduce-add-double-1.ispc
  23. +2 −1  tests/reduce-add-double-2.ispc
  24. +1 −1  tests/reduce-add-double.ispc
  25. +2 −1  tests/reduce-add-float-1.ispc
  26. +2 −1  tests/reduce-add-float-2.ispc
  27. +1 −1  tests/reduce-add-float.ispc
  28. +2 −1  tests/reduce-add-int-1.ispc
  29. +2 −1  tests/reduce-add-int.ispc
  30. +2 −1  tests/reduce-add-int64-1.ispc
  31. +2 −1  tests/reduce-add-int64.ispc
  32. +2 −1  tests/reduce-add-uint-1.ispc
  33. +1 −1  tests/reduce-add-uint.ispc
  34. +2 −1  tests/reduce-add-uint64-1.ispc
  35. +3 −1 tests/reduce-add-uint64.ispc
  36. +3 −3 tests/reduce-equal-13.ispc
  37. +1 −1  tests/reduce-equal-3.ispc
  38. +1 −1  tests/reduce-equal-4.ispc
  39. +1 −1  tests/reduce-equal-9.ispc
  40. +1 −1  tests/reduce-equal.ispc
  41. +2 −2 tests/reduce-max-double.ispc
  42. +2 −2 tests/reduce-max-float.ispc
  43. +2 −2 tests/reduce-max-int.ispc
  44. +2 −2 tests/reduce-max-int64.ispc
  45. +1 −1  tests/reduce-max-uint.ispc
  46. +1 −1  tests/reduce-max-uint64.ispc
  47. +1 −1  tests/reduce-min-double.ispc
  48. +1 −1  tests/reduce-min-float.ispc
  49. +2 −2 tests/reduce-min-uint.ispc
  50. +2 −2 tests/reduce-min-uint64.ispc
  51. +7 −3 tests/shuffle-3.ispc
  52. +7 −3 tests/shuffle.ispc
  53. +8 −4 tests/shuffle2-1.ispc
  54. +8 −4 tests/shuffle2-2.ispc
  55. +8 −4 tests/shuffle2-3.ispc
  56. +8 −4 tests/shuffle2-7.ispc
  57. +8 −4 tests/shuffle2-8.ispc
  58. +8 −4 tests/shuffle2-9.ispc
  59. +2 −2 tests/store-int16-1.ispc
  60. +2 −2 tests/store-int16.ispc
  61. +1 −1  tests/test-124.ispc
  62. +1 −1  tests/test-127.ispc
  63. +2 −2 tests/test-128.ispc
  64. +2 −2 tests/test-129.ispc
View
8 examples/common.mk
@@ -14,7 +14,7 @@ CPP_OBJS=$(addprefix objs/, $(CPP_SRC:.cpp=.o) $(TASK_OBJ))
default: $(EXAMPLE)
-all: $(EXAMPLE) $(EXAMPLE)-sse4 $(EXAMPLE)-generic16
+all: $(EXAMPLE) $(EXAMPLE)-sse4 $(EXAMPLE)-generic16 $(EXAMPLE)-scalar
.PHONY: dirs clean
@@ -57,3 +57,9 @@ objs/$(ISPC_SRC:.ispc=)_generic16.o: objs/$(ISPC_SRC:.ispc=)_generic16.cpp
$(EXAMPLE)-generic16: $(CPP_OBJS) objs/$(ISPC_SRC:.ispc=)_generic16.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
+
+objs/$(ISPC_SRC:.ispc=)_scalar.o: $(ISPC_SRC)
+ $(ISPC) $< -o $@ --target=generic-1
+
+$(EXAMPLE)-scalar: $(CPP_OBJS) objs/$(ISPC_SRC:.ispc=)_scalar.o
+ $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
View
5 run_tests.py
@@ -53,7 +53,8 @@
else:
ispc_exe = "../Release/ispc.exe"
-is_generic_target = options.target.find("generic-") != -1
+is_generic_target = (options.target.find("generic-") != -1 and
+ options.target != "generic-1")
if is_generic_target and options.include_file == None:
if options.target == "generic-4":
sys.stderr.write("No generics #include specified; using examples/intrinsics/sse4.h\n")
@@ -224,7 +225,7 @@ def run_test(filename):
"in test %s\n" % filename)
return (1, 0)
else:
- is_generic_target = options.target.find("generic-") != -1
+ global is_generic_target
if is_generic_target:
obj_name = "%s.cpp" % filename
View
4 tests/array-gather-multi-unif.ispc
@@ -15,7 +15,9 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
}
export void result(uniform float RET[]) {
- if (programCount == 4)
+ if (programCount == 1)
+ RET[programIndex] = 1;
+ else if (programCount == 4)
RET[programIndex] = 5.;
else
RET[programIndex] = 10.;
View
8 tests/array-pointer-duality-1.ispc
@@ -3,13 +3,13 @@ export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
- uniform float a[programCount];
- for (unsigned int i = 0; i < programCount; ++i)
- a[i] = aFOO[i];
+ uniform float a[programCount+4];
+ for (unsigned int i = 0; i < programCount+4; ++i)
+ a[i] = aFOO[min((int)i, programCount)];
RET[programIndex] = *(a + 2);
}
export void result(uniform float RET[]) {
- RET[programIndex] = 3;
+ RET[programIndex] = (programCount == 1) ? 1 : 3;
}
View
2  tests/array-scatter-unif-2.ispc
@@ -14,4 +14,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
}
-export void result(uniform float RET[]) { RET[programIndex] = 5; }
+export void result(uniform float RET[]) { RET[programIndex] = programCount == 1 ? 0 : 5; }
View
4 tests/array-scatter-unif.ispc
@@ -14,7 +14,9 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
- if (programCount == 4)
+ if (programCount == 1)
+ RET[programIndex] = 0;
+ else if (programCount == 4)
RET[programIndex] = 2;
else
RET[programIndex] = 4;
View
2  tests/atomics-10.ispc
@@ -13,5 +13,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 2;
+ RET[programIndex] = programCount == 1 ? 1 : 2;
}
View
2  tests/atomics-13.ispc
@@ -12,5 +12,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = (programCount/2) - 1;
+ RET[programIndex] = programCount == 1 ? 0 : ((programCount/2) - 1);
}
View
2  tests/atomics-6.ispc
@@ -10,5 +10,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 3000;
+ RET[programIndex] = (programCount == 1) ? 2 : 3000;
}
View
2  tests/atomics-8.ispc
@@ -12,5 +12,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = programCount;
+ RET[programIndex] = (programCount == 1) ? 0 : programCount;
}
View
2  tests/atomics-9.ispc
@@ -13,5 +13,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 1;
+ RET[programIndex] = (programCount == 1) ? 0 : 1;
}
View
2  tests/broadcast-1.ispc
@@ -3,7 +3,7 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
int a = aFOO[programIndex];
- int br = broadcast(a, (uniform int)b-2);
+ int br = (programCount == 1) ? 4 : broadcast(a, (uniform int)b-2);
RET[programIndex] = br;
}
View
2  tests/broadcast-2.ispc
@@ -3,7 +3,7 @@ export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
int16 a = aFOO[programIndex];
- int16 b = broadcast(a, 2);
+ int16 b = (programCount == 1) ? 3 : broadcast(a, 2);
RET[programIndex] = b;
}
View
2  tests/broadcast-3.ispc
@@ -3,7 +3,7 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
int8 a = aFOO[programIndex];
- int8 br = broadcast(a, (uniform int)b-2);
+ int8 br = (programCount == 1) ? 4 : broadcast(a, (uniform int)b-2);
RET[programIndex] = br;
}
View
2  tests/broadcast.ispc
@@ -3,7 +3,7 @@ export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
float a = aFOO[programIndex];
- float b = broadcast(a, 2);
+ float b = (programCount == 1) ? 3 : broadcast(a, 2);
RET[programIndex] = b;
}
View
4 tests/extract-1.ispc
@@ -3,9 +3,9 @@ export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
double a = programIndex;
- RET[programIndex] = extract(a, 3);
+ RET[programIndex] = extract(a, min(programCount-1, 3));
}
export void result(uniform float RET[]) {
- RET[programIndex] = 3;
+ RET[programIndex] = (programCount == 1) ? 0 : 3;
}
View
2  tests/packed-load-3.ispc
@@ -12,5 +12,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 2;
+ RET[programIndex] = (programCount == 1) ? 1 : 2;
}
View
10 tests/packed-load-5.ispc
@@ -15,8 +15,12 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- for (uniform int i = 0; i < programCount/2; ++i) {
- RET[2*i+1] = 10+i;
- RET[2*i] = 10+programCount/2+i;
+ if (programCount == 1)
+ RET[0] = 10;
+ else {
+ for (uniform int i = 0; i < programCount/2; ++i) {
+ RET[2*i+1] = 10+i;
+ RET[2*i] = 10+programCount/2+i;
+ }
}
}
View
2  tests/packed-store-3.ispc
@@ -13,5 +13,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = programCount/2;
+ RET[programIndex] = (programCount == 1) ? 1 : programCount/2;
}
View
2  tests/popcnt-3.ispc
@@ -8,4 +8,4 @@ export void f_f(uniform float RET[4], uniform float aFOO[]) {
RET[programIndex] = popcnt(a < 3);
}
-export void result(uniform float RET[]) { RET[programIndex] = 2; }
+export void result(uniform float RET[]) { RET[programIndex] = programCount == 1 ? 1 : 2; }
View
6 tests/ptr-assign-lhs-math-1.ispc
@@ -2,8 +2,9 @@
export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
- uniform float a[programCount];
+ uniform float a[programCount+1];
a[programIndex] = aFOO[programIndex];
+ a[programCount] = 1;
uniform float * uniform ptr = a;
*(ptr+1) = 0;
@@ -12,5 +13,6 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
export void result(uniform float RET[]) {
RET[programIndex] = 1+programIndex;
- RET[1] = 0;
+ if (programCount > 0)
+ RET[1] = 0;
}
View
5 tests/reduce-add-double-1.ispc
@@ -5,7 +5,7 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
double v = aFOO[programIndex];
- uniform float m;
+ uniform float m = 42;
int iv = (int)v;
if (iv & 1)
m = reduce_add((double)iv);
@@ -14,7 +14,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 4;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 4;
else if (programCount == 8) x = 16;
else if (programCount == 16) x = 64;
RET[programIndex] = x;
View
3  tests/reduce-add-double-2.ispc
@@ -13,7 +13,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 10;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 10;
else if (programCount == 8) x = 36;
else if (programCount == 16) x = 136;
RET[programIndex] = x;
View
2  tests/reduce-add-double.ispc
@@ -11,4 +11,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? -1 : -3; }
View
3  tests/reduce-add-float-1.ispc
@@ -14,7 +14,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 4;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 4;
else if (programCount == 8) x = 16;
else if (programCount == 16) x = 64;
RET[programIndex] = x;
View
3  tests/reduce-add-float-2.ispc
@@ -13,7 +13,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 10;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 10;
else if (programCount == 8) x = 36;
else if (programCount == 16) x = 136;
RET[programIndex] = x;
View
2  tests/reduce-add-float.ispc
@@ -11,4 +11,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? -1 : -3; }
View
3  tests/reduce-add-int-1.ispc
@@ -14,7 +14,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 4;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 4;
else if (programCount == 8) x = 16;
else if (programCount == 16) x = 64;
RET[programIndex] = x;
View
3  tests/reduce-add-int.ispc
@@ -14,7 +14,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 10;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 10;
else if (programCount == 8) x = 36;
else if (programCount == 16) x = 136;
RET[programIndex] = x;
View
3  tests/reduce-add-int64-1.ispc
@@ -14,7 +14,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 4;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 4;
else if (programCount == 8) x = 16;
else if (programCount == 16) x = 64;
RET[programIndex] = x;
View
3  tests/reduce-add-int64.ispc
@@ -13,7 +13,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 10;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 10;
else if (programCount == 8) x = 36;
else if (programCount == 16) x = 136;
RET[programIndex] = x;
View
3  tests/reduce-add-uint-1.ispc
@@ -14,7 +14,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 4;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 4;
else if (programCount == 8) x = 16;
else if (programCount == 16) x = 64;
RET[programIndex] = x;
View
2  tests/reduce-add-uint.ispc
@@ -12,4 +12,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = 10 * programCount/4; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 1 : (10 * programCount/4); }
View
3  tests/reduce-add-uint64-1.ispc
@@ -14,7 +14,8 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
uniform int x = -1234;
- if (programCount == 4) x = 4;
+ if (programCount == 1) x = 1;
+ else if (programCount == 4) x = 4;
else if (programCount == 8) x = 16;
else if (programCount == 16) x = 64;
RET[programIndex] = x;
View
4 tests/reduce-add-uint64.ispc
@@ -11,4 +11,6 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = 10 * programCount/4; }
+export void result(uniform float RET[]) {
+ RET[programIndex] = (programCount == 1) ? 1 : (10 * programCount/4);
+}
View
6 tests/reduce-equal-13.ispc
@@ -4,8 +4,8 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
int a = aFOO[programIndex&1];
RET[programIndex] = 1;
- uniform bool re;
- uniform int val;
+ uniform bool re = false;
+ uniform int val = 16;
if (programIndex & 1) {
re = reduce_equal(a, &val);
}
@@ -13,5 +13,5 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 258;
+ RET[programIndex] = (programCount == 1) ? 16 : 258;
}
View
2  tests/reduce-equal-3.ispc
@@ -9,5 +9,5 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 0;
+ RET[programIndex] = (programCount == 1) ? 1 : 0;
}
View
2  tests/reduce-equal-4.ispc
@@ -2,7 +2,7 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int a = aFOO[programIndex/(programCount/2)];
+ int a = aFOO[programIndex/max(1, (programCount/2))];
RET[programIndex] = 0;
if (programIndex >= programCount/2 && a < 4)
RET[programIndex] = reduce_equal(a) ? 1 : 0;
View
2  tests/reduce-equal-9.ispc
@@ -11,5 +11,5 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 0;
+ RET[programIndex] = (programCount == 1) ? 1 : 0;
}
View
2  tests/reduce-equal.ispc
@@ -7,5 +7,5 @@ export void f_f(uniform float RET[], uniform float aFOO[]) {
}
export void result(uniform float RET[]) {
- RET[programIndex] = 0;
+ RET[programIndex] = (programCount == 1) ? 1 : 0;
}
View
4 tests/reduce-max-double.ispc
@@ -5,10 +5,10 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
double v = aFOO[programIndex];
- uniform float m;
+ uniform float m = 42;
if (v >= 3)
m = reduce_max(-v);
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 42 : -3; }
View
4 tests/reduce-max-float.ispc
@@ -5,10 +5,10 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float v = aFOO[programIndex];
- uniform float m;
+ uniform float m = 42;
if (v >= 3)
m = reduce_max(-v);
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 42 : -3; }
View
4 tests/reduce-max-int.ispc
@@ -5,10 +5,10 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float v = aFOO[programIndex];
- uniform float m;
+ uniform float m = 42;
if (v >= 3)
m = reduce_max(-(int)v);
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 42 : -3; }
View
4 tests/reduce-max-int64.ispc
@@ -5,10 +5,10 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float v = aFOO[programIndex];
- uniform float m;
+ uniform float m = 42;
if (v >= 3)
m = reduce_max(-(int64)v);
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 42 : -3; }
View
2  tests/reduce-max-uint.ispc
@@ -11,4 +11,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = 2; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 1 : 2; }
View
2  tests/reduce-max-uint64.ispc
@@ -11,4 +11,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = 2; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 1 : 2; }
View
2  tests/reduce-min-double.ispc
@@ -11,4 +11,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -2; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? -1 : -2; }
View
2  tests/reduce-min-float.ispc
@@ -11,4 +11,4 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = -2; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? -1 : -2; }
View
4 tests/reduce-min-uint.ispc
@@ -5,10 +5,10 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float v = aFOO[programIndex];
- uniform float m;
+ uniform float m = 42;
if (v >= 3)
m = reduce_min((unsigned int)v);
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = 3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 42 : 3; }
View
4 tests/reduce-min-uint64.ispc
@@ -5,10 +5,10 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float v = aFOO[programIndex];
- uniform float m;
+ uniform float m = 42;
if (v >= 3)
m = reduce_min((unsigned int64)v);
RET[programIndex] = m;
}
-export void result(uniform float RET[]) { RET[programIndex] = 3; }
+export void result(uniform float RET[]) { RET[programIndex] = (programCount == 1) ? 42 : 3; }
View
10 tests/shuffle-3.ispc
@@ -2,9 +2,13 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int8 a = aFOO[programIndex];
- int8 shuf = shuffle(a, 1);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 2;
+ else {
+ int8 a = aFOO[programIndex];
+ int8 shuf = shuffle(a, 1);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
10 tests/shuffle.ispc
@@ -2,9 +2,13 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int32 a = aFOO[programIndex];
- int32 shuf = shuffle(a, 1);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 2;
+ else {
+ int32 a = aFOO[programIndex];
+ int32 shuf = shuffle(a, 1);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
12 tests/shuffle2-1.ispc
@@ -2,10 +2,14 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int32 aa = aFOO[programIndex];
- int32 bb = aa + programCount;
- int32 shuf = shuffle(aa, bb, programCount + 1);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 3;
+ else {
+ int32 aa = aFOO[programIndex];
+ int32 bb = aa + programCount;
+ int32 shuf = shuffle(aa, bb, programCount + 1);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
12 tests/shuffle2-2.ispc
@@ -2,10 +2,14 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int32 aa = aFOO[programIndex];
- int32 bb = aa + programCount;
- int32 shuf = shuffle(aa, bb, programIndex + 2);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 3;
+ else {
+ int32 aa = aFOO[programIndex];
+ int32 bb = aa + programCount;
+ int32 shuf = shuffle(aa, bb, programIndex + 2);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
12 tests/shuffle2-3.ispc
@@ -2,10 +2,14 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- float aa = aFOO[programIndex];
- float bb = aa + programCount;
- float shuf = shuffle(aa, bb, programIndex + 2 + (int)b - 5);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 3;
+ else {
+ float aa = aFOO[programIndex];
+ float bb = aa + programCount;
+ float shuf = shuffle(aa, bb, programIndex + 2 + (int)b - 5);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
12 tests/shuffle2-7.ispc
@@ -2,10 +2,14 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int16 aa = aFOO[programIndex];
- int16 bb = aa + programCount;
- int16 shuf = shuffle(aa, bb, programCount + 1);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 3;
+ else {
+ int16 aa = aFOO[programIndex];
+ int16 bb = aa + programCount;
+ int16 shuf = shuffle(aa, bb, programCount + 1);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
12 tests/shuffle2-8.ispc
@@ -2,10 +2,14 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int8 aa = aFOO[programIndex];
- int8 bb = aa + programCount;
- int8 shuf = shuffle(aa, bb, programIndex + 2);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 3;
+ else {
+ int8 aa = aFOO[programIndex];
+ int8 bb = aa + programCount;
+ int8 shuf = shuffle(aa, bb, programIndex + 2);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
12 tests/shuffle2-9.ispc
@@ -2,10 +2,14 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- int16 aa = aFOO[programIndex];
- int16 bb = aa + programCount;
- int16 shuf = shuffle(aa, bb, programIndex + 2 + (int)b - 5);
- RET[programIndex] = shuf;
+ if (programCount == 1)
+ RET[0] = 3;
+ else {
+ int16 aa = aFOO[programIndex];
+ int16 bb = aa + programCount;
+ int16 shuf = shuffle(aa, bb, programIndex + 2 + (int)b - 5);
+ RET[programIndex] = shuf;
+ }
}
export void result(uniform float RET[]) {
View
4 tests/store-int16-1.ispc
@@ -1,8 +1,8 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- uniform unsigned int16 x[2*programCount];
- for (uniform int i = 0; i < 2*programCount; ++i)
+ uniform unsigned int16 x[2*programCount+1];
+ for (uniform int i = 0; i < 2*programCount+1; ++i)
x[i] = 0xffff;
unsigned int16 val = aFOO[programIndex];
x[2+programIndex] = val;
View
4 tests/store-int16.ispc
@@ -1,8 +1,8 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
- uniform int16 x[2*programCount];
- for (uniform int i = 0; i < 2*programCount; ++i)
+ uniform int16 x[2*programCount+1];
+ for (uniform int i = 0; i < 2*programCount+1; ++i)
x[i] = 0xffff;
unsigned int8 val = aFOO[programIndex];
x[2+programIndex] = val;
View
2  tests/test-124.ispc
@@ -10,5 +10,5 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[4]) {
- RET[programIndex] = 1;
+ RET[programIndex] = (programCount == 1) ? 0 : 1;
}
View
2  tests/test-127.ispc
@@ -9,5 +9,5 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
export void result(uniform float RET[]) {
- RET[programIndex] = 10;
+ RET[programIndex] = (programCount == 1) ? 4 : 10;
}
View
4 tests/test-128.ispc
@@ -4,9 +4,9 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float a = aFOO[programIndex];
- RET[programIndex] = extract(a, 1);
+ RET[programIndex] = extract(a, min(1, programCount-1));
}
export void result(uniform float RET[]) {
- RET[programIndex] = 2.;
+ RET[programIndex] = (programCount == 1) ? 1 : 2.;
}
View
4 tests/test-129.ispc
@@ -4,10 +4,10 @@ export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float a = aFOO[programIndex];
- RET[programIndex] = extract(a, (uniform int)b-3);
+ RET[programIndex] = extract(a, min((uniform int)b-3, programCount-1));
}
export void result(uniform float RET[]) {
- RET[programIndex] = 3;
+ RET[programIndex] = (programCount == 1) ? 1 : 3;
}
Please sign in to comment.
Something went wrong with that request. Please try again.