Add roundings for varying double in knc.h and knl.h
This commit is contained in:
12
tests/test-149.ispc
Normal file
12
tests/test-149.ispc
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double a = aFOO[programIndex];
|
||||
RET[programIndex] = round(a+.49999);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1 + (double) programIndex;
|
||||
}
|
||||
12
tests/test-150.ispc
Normal file
12
tests/test-150.ispc
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double a = aFOO[programIndex];
|
||||
RET[programIndex] = round(a+(0.50001d));
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = programIndex + 2;
|
||||
}
|
||||
12
tests/test-151.ispc
Normal file
12
tests/test-151.ispc
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double a = aFOO[programIndex];
|
||||
RET[programIndex] = floor(a+.99999);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1 +(double) programIndex;
|
||||
}
|
||||
12
tests/test-152.ispc
Normal file
12
tests/test-152.ispc
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double a = aFOO[programIndex];
|
||||
RET[programIndex] = ceil(a-1e-5);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1 + (double) programIndex;
|
||||
}
|
||||
12
tests/test-153.ispc
Normal file
12
tests/test-153.ispc
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double a = aFOO[programIndex];
|
||||
RET[programIndex] = ceil(-a+1e-5);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = - (double) programIndex;
|
||||
}
|
||||
Reference in New Issue
Block a user