diff options
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 13 | ||||
-rw-r--r-- | sc/source/core/opencl/formulagroupcl_public.hxx | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 037760e42175..abd3230ff20e 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -470,11 +470,18 @@ public: ss << " int loopOffset = l*512;\n"; ss << " if((loopOffset + lidx + offset + 256) < min( offset + windowSize, arrayLength))\n"; ss << " tmp = "; - ss << mpCodeGen->Gen2("fsum(A[loopOffset + lidx + offset], 0)", - "fsum(A[loopOffset + lidx + offset + 256], 0)"); + ss << mpCodeGen->Gen2( + std::string( + "legalize(A[loopOffset + lidx + offset], ")+ + mpCodeGen->GetBottom() +")", + std::string( + "legalize(A[loopOffset + lidx + offset + 256], ")+ + mpCodeGen->GetBottom() +")" + ); ss << ";"; ss << " else if ((loopOffset + lidx + offset) < min(offset + windowSize, arrayLength))\n"; - ss << " tmp = fsum(A[loopOffset + lidx + offset], 0);\n"; + ss << " tmp = legalize(A[loopOffset + lidx + offset],"; + ss << mpCodeGen->GetBottom() << ");\n"; ss << " shm_buf[lidx] = tmp;\n"; ss << " barrier(CLK_LOCAL_MEM_FENCE);\n"; ss << " for (int i = 128; i >0; i/=2) {\n"; diff --git a/sc/source/core/opencl/formulagroupcl_public.hxx b/sc/source/core/opencl/formulagroupcl_public.hxx index e50de3731f64..ccee5e16b92b 100644 --- a/sc/source/core/opencl/formulagroupcl_public.hxx +++ b/sc/source/core/opencl/formulagroupcl_public.hxx @@ -12,6 +12,7 @@ const char* publicFunc = "int isNan(double a) { return a != a; }\n" + "double legalize(double a, double b) { return isNan(a)?b:a; }\n" "double fsum(double a, double b) { return isNan(a)?b:a+b; }\n" "double fsub(double a, double b) { return a-b; }\n" "double fdiv(double a, double b) { return a/b; }\n" |