Add roundings for varying double in knc.h and knl.h

This commit is contained in:
Vsevolod Livinskiy
2015-05-14 16:13:08 +03:00
parent 8fdd9a7ef7
commit 12ff721ec1
7 changed files with 99 additions and 0 deletions

12
tests/test-149.ispc Normal file
View 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
View 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
View 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
View 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
View 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;
}