[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 13 12:15:24 UTC 2018


 sc/source/core/opencl/cl-test.ods        |binary
 sc/source/core/opencl/formulagroupcl.cxx |    7 +++++++
 2 files changed, 7 insertions(+)

New commits:
commit b15ded2ee474d6531e2a9b358d57bff9a6902a92
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Oct 16 13:53:54 2018 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Nov 13 13:14:59 2018 +0100

    work around nan() not propagating its argument with nVidia OpenCL
    
    And added a check for this to cl-test.ods .
    
    Change-Id: I9b62f2cbef46d5b3dc0adda2b97dda9b8465fe88
    Reviewed-on: https://gerrit.libreoffice.org/63174
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/sc/source/core/opencl/cl-test.ods b/sc/source/core/opencl/cl-test.ods
index fa8166bac128..7e2bae4cb3c8 100644
Binary files a/sc/source/core/opencl/cl-test.ods and b/sc/source/core/opencl/cl-test.ods differ
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 85c8940c18b1..9cc9df1724e0 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -47,6 +47,13 @@ static const char* const publicFunc =
  "\n"
  "double CreateDoubleError(ulong nErr)\n"
  "{\n"
+ // nVidia OpenCL, at least on Linux, seems to ignore the argument to nan(),
+ // so using that would not propagate the type of error, work that around
+ // by directly constructing the proper IEEE double NaN value
+ // TODO: maybe use a better way to detect such systems?
+ "#ifdef cl_nv_pragma_unroll\n"
+ "    return as_double(0x7FF8000000000000+nErr);\n"
+ "#endif\n"
  "    return nan(nErr);\n"
  "}\n"
  "\n"


More information about the Libreoffice-commits mailing list