Add unmasked { } statement.
This reestablishes an "all on" execution mask for the gang, which can be useful for nested parallelism..
This commit is contained in:
17
tests/unmasked-1.ispc
Normal file
17
tests/unmasked-1.ispc
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
if (a == 2) {
|
||||
unmasked {
|
||||
a = 0;
|
||||
}
|
||||
}
|
||||
RET[programIndex] = a;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
18
tests/unmasked-2.ispc
Normal file
18
tests/unmasked-2.ispc
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
int count = 0;
|
||||
for (int i = 0; i < a; ++i) {
|
||||
unmasked {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
RET[programIndex] = count;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = programCount;
|
||||
}
|
||||
19
tests/unmasked-3.ispc
Normal file
19
tests/unmasked-3.ispc
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
int count = 0;
|
||||
for (int i = 0; i < a; ++i) {
|
||||
ccontinue;
|
||||
unmasked {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
RET[programIndex] = count;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user