sc/source/core/opencl/opencl_device.cxx |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 141e9aa11bd43f209dec8d0f00121af4924fae16
Author: Michael Meeks <michael.me...@collabora.com>
Date:   Tue Nov 11 15:55:23 2014 +0000

    sc:opencl waste less time measuring CPU performance.
    
    Change-Id: I7650896e794b9107d2e454e0f694ee6f94b0ed2b

diff --git a/sc/source/core/opencl/opencl_device.cxx 
b/sc/source/core/opencl/opencl_device.cxx
index 2703040..122cb56 100644
--- a/sc/source/core/opencl/opencl_device.cxx
+++ b/sc/source/core/opencl/opencl_device.cxx
@@ -358,8 +358,14 @@ ds_status evaluateScoreForDevice(ds_device* device, void* 
evalData)
         timer kernelTime;
         timerStart(&kernelTime);
 
+        // InterpretTail - the S/W fallback is nothing like as efficient
+        // as any good openCL implementation: no SIMD, tons of branching
+        // in the inner loops etc. Generously characterise it as only 10x
+        // slower than the above.
+        int nInterpretTailFactor = 10;
+
         LibreOfficeDeviceEvaluationIO* testData = 
(LibreOfficeDeviceEvaluationIO*)evalData;
-        for (unsigned long j = 0; j < testData->outputSize; j++)
+        for (unsigned long j = 0; j < testData->outputSize / 
nInterpretTailFactor; j++)
         {
             double fAverage = 0.0f;
             double fMin = DBL_MAX;
@@ -374,17 +380,14 @@ ds_status evaluateScoreForDevice(ds_device* device, void* 
evalData)
             testData->output[j] = fAverage + (fMin * fSoP);
         }
 
-        // InterpretTail - the S/W fallback is nothing like as efficient
-        // as any good openCL implementation: no SIMD, tons of branching
-        // in the inner loops etc. Generously characterise it as only 10x
-        // slower than the above.
-        float fInterpretTailFactor = 10.0;
-
         device->score = (void*)new LibreOfficeDeviceScore;
         ((LibreOfficeDeviceScore*)device->score)->fTime = 
timerCurrent(&kernelTime);
         ((LibreOfficeDeviceScore*)device->score)->bNoCLErrors = true;
 
-        ((LibreOfficeDeviceScore*)device->score)->fTime *= 
fInterpretTailFactor;
+        // Since we the test size by nInterpretTailFactor to save time, and to
+        // accelerate this test, we need to apply the factor twice to
+        // get a realistic idea of the real time taken by InterpretTail.
+        ((LibreOfficeDeviceScore*)device->score)->fTime *= 
nInterpretTailFactor * nInterpretTailFactor;
     }
     return DS_SUCCESS;
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to