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

2023-02-02 Thread Ilmari Lauhakangas (via logerrit)
 opencl/source/opencl_device.cxx |   18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

New commits:
commit c544f9ea78eab46c4f5230273a5a8571b28ea84d
Author: Ilmari Lauhakangas 
AuthorDate: Thu Feb 2 16:19:11 2023 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Fri Feb 3 07:13:52 2023 +

Use raw string literal in opencl to keep PMD static analyser happy

Change-Id: Ibf2bd12b79c6e7c7eae59fc516e75c1bda971a7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146502
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index ca9f4f43b5d1..e8712cb5a745 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -30,8 +30,6 @@
 #define INPUTSIZE  15360
 #define OUTPUTSIZE 15360
 
-#define STRINGIFY(...) #__VA_ARGS__"\n"
-
 namespace {
 
 void DS_CHECK_STATUS(cl_int status, char const * name) {
@@ -55,13 +53,13 @@ struct LibreOfficeDeviceEvaluationIO
 tools::ULong outputSize;
 };
 
-const char* source = STRINGIFY(
-\n#if defined(KHR_DP_EXTENSION)
-\n#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-\n#elif defined(AMD_DP_EXTENSION)
-\n#pragma OPENCL EXTENSION cl_amd_fp64 : enable
-\n#endif
-\n
+const char* source = R"delimit(
+#if defined(KHR_DP_EXTENSION)
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#elif defined(AMD_DP_EXTENSION)
+#pragma OPENCL EXTENSION cl_amd_fp64 : enable
+#endif
+
 int isNan(fp_t a) { return a != a; }
 fp_t fsum(fp_t a, fp_t b) { return a + b; }
 
@@ -108,7 +106,7 @@ const char* source = STRINGIFY(
 fp_t tmp1 = fMin(input1) * fSoP(input2, input3);
 result[gid0] = fsum(tmp0, tmp1);
 }
-);
+)delimit";
 
 size_t sourceSize[] = { strlen(source) };
 


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

2021-02-11 Thread Ilmari Lauhakangas (via logerrit)
 opencl/source/openclconfig.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 03b070a71772c93bbac0bfb07e2d9e6fbf544ef5
Author: Ilmari Lauhakangas 
AuthorDate: Thu Feb 11 09:36:53 2021 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Thu Feb 11 10:02:21 2021 +0100

Update OpenCL denylist and allowlist

Add bad Intel driver reported by a new developer.
Remove superfluous AMD allowlist entry.

Change-Id: Ide5092dab7e0fa7f40ee512ba2dc9283bd9e95be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110749
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx
index 4403c1d98e1a..5467fc5e83c9 100644
--- a/opencl/source/openclconfig.cxx
+++ b/opencl/source/openclconfig.cxx
@@ -29,9 +29,8 @@ OpenCLConfig::OpenCLConfig() :
 // done elsewhere in the code), so presumably there is a known
 // good reason for it.
 maDenyList.insert(ImplMatcher("Windows", "", "Intel\\(R\\) Corporation", 
"", "9\\.17\\.10\\.2884"));
-
-// This is what I have tested on Linux and it works for our unit tests.
-maAllowList.insert(ImplMatcher("Linux", "", "Advanced Micro Devices, 
Inc\\.", "", "1445\\.5 \\(sse2,avx\\)"));
+// This was reported to produce bogus values in unit tests
+maDenyList.insert(ImplMatcher("Windows", "", "Intel\\(R\\) Corporation", 
"", "27\\.20\\.100\\.8681"));
 
 // For now, assume that AMD, Intel and NVIDIA drivers are good
 maAllowList.insert(ImplMatcher("", "", "Advanced Micro Devices, Inc\\.", 
"", ""));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-14 Thread Libreoffice Gerrit user
 opencl/source/openclwrapper.cxx  |5 +++
 sc/inc/calcconfig.hxx|   11 +++
 sc/inc/recursionhelper.hxx   |4 ++
 sc/qa/unit/copy_paste_test.cxx   |2 -
 sc/source/core/data/formulacell.cxx  |   45 +++
 sc/source/core/opencl/formulagroupcl.cxx |3 ++
 sc/source/core/tool/calcconfig.cxx   |   37 +
 sc/source/core/tool/recursionhelper.cxx  |   15 ++
 sc/source/ui/unoobj/docuno.cxx   |4 ++
 9 files changed, 119 insertions(+), 7 deletions(-)

New commits:
commit 12c95935f265b484c0a2fa13470085710729c903
Author: Luboš Luňák 
AuthorDate: Fri Oct 12 11:34:20 2018 +0200
Commit: Luboš Luňák 
CommitDate: Wed Nov 14 16:09:16 2018 +0100

$SC_FORCE_CALCULATION to force Calc use opencl/threads for everything

So that e.g. unit tests can be easily run with OpenCL forced. This forces
even single cells to be evaluated using the forced method (many correctness
tests are just a single cell which normally would not be used for grouped
calculation).

Change-Id: If5c6e77a6e0d8696d5416d760cf5e47b8acf3d27
Reviewed-on: https://gerrit.libreoffice.org/63188
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 4383930ec0d4..436906340c53 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -761,6 +761,11 @@ void findDeviceInfoFromDeviceId(cl_device_id aDeviceId, 
size_t& rDeviceId, size_
 
 bool canUseOpenCL()
 {
+if( const char* env = getenv( "SC_FORCE_CALCULATION" ))
+{
+if( strcmp( env, "opencl" ) == 0 )
+return true;
+}
 return !getenv("SAL_DISABLE_OPENCL") && 
officecfg::Office::Common::Misc::UseOpenCL::get();
 }
 
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 2f840f9abdcb..ee99b0c10592 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -27,6 +27,16 @@ enum ScRecalcOptions
 RECALC_ASK,
 };
 
+// Env.var. SC_FORCE_CALCULATION can be used to force all calculation
+// to be done using OpenCL or group threading (even for single cells).
+enum ForceCalculationType
+{
+ForceCalculationNone, // do not force anything
+ForceCalculationCore, // "core", use only non-threaded normal code
+ForceCalculationOpenCL, // "opencl", force OpenCL
+ForceCalculationThreads // "threads", force threaded code
+};
+
 /**
  * Configuration options for formula interpreter.
  */
@@ -47,6 +57,7 @@ struct SC_DLLPUBLIC ScCalcConfig
 
 static bool isOpenCLEnabled();
 static bool isThreadingEnabled();
+static ForceCalculationType getForceCalculationType();
 
 bool mbOpenCLSubsetOnly:1;
 bool mbOpenCLAutoSelect:1;
diff --git a/sc/inc/recursionhelper.hxx b/sc/inc/recursionhelper.hxx
index 23422d7c2a71..d91ee0cfbe58 100644
--- a/sc/inc/recursionhelper.hxx
+++ b/sc/inc/recursionhelper.hxx
@@ -59,6 +59,7 @@ class ScRecursionHelper
 boolbDoingRecursion;
 boolbInIterationReturn;
 boolbConverging;
+std::vector< ScFormulaCell* >   aTemporaryGroupCells;
 
 void Init();
 void ResetIteration();
@@ -107,6 +108,9 @@ public:
 bool PushFormulaGroup(ScFormulaCell* pCell);
 void PopFormulaGroup();
 bool AnyParentFGInCycle();
+
+void AddTemporaryGroupCell(ScFormulaCell* cell);
+void CleanTemporaryGroupCells();
 };
 
 /** A class to wrap ScRecursionHelper::PushFormulaGroup(),
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index e2a8b51a030a..742005df7e26 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -207,7 +207,7 @@ void ScCopyPasteTest::testTdf84411()
 CPPUNIT_ASSERT(pModel != nullptr);
 bool bOpenCLState = ScCalcConfig::isOpenCLEnabled();
 pModel->enableOpenCL(false);
-CPPUNIT_ASSERT(!ScCalcConfig::isOpenCLEnabled());
+CPPUNIT_ASSERT(!ScCalcConfig::isOpenCLEnabled() || 
ScCalcConfig::getForceCalculationType() == ForceCalculationOpenCL);
 pModel->enableAutomaticCalculation(true);
 
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 7b0f9e47b3fe..8d16fdf0d352 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1483,12 +1483,43 @@ public:
 }
 }
 };
-}
+
+// Forced calculation: OpenCL and threads require formula groups, so force 
even single cells to be a "group".
+// Remove the group again at the end, since there are some places throughout 
the code
+// that do not handle well groups with just 1 cell. Remove the groups only 
when the recursion level
+// reaches 0 again (groups contain some info such as disabling threading 
because of cycles, so removing
+// a group immediately would remove the info), for this reason affected cells 
are stored in 

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

2017-05-17 Thread Stephan Bergmann
 opencl/source/opencl_device.cxx |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit d4a5e6b42c4bef40aa5411dbb49bca364a4846b7
Author: Stephan Bergmann 
Date:   Wed May 17 11:31:51 2017 +0200

Turn macro into function

Change-Id: I6df7a287da74e49857e7fa3f0ba1cf67ab3bc74a

diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index 9dc0130d6bad..fed84cfdf0c6 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -40,16 +40,17 @@
 
 #define STRINGIFY(...) #__VA_ARGS__"\n"
 
-#define DS_CHECK_STATUS(status, name) \
-if (CL_SUCCESS != status) \
-{ \
-SAL_INFO("opencl.device", "Error code is " << status << " at " name); \
-}
-
 namespace opencl {
 
 namespace {
 
+void DS_CHECK_STATUS(cl_int status, char const * name) {
+if (CL_SUCCESS != status)
+{
+SAL_INFO("opencl.device", "Error code is " << status << " at " << name);
+}
+}
+
 bool bIsDeviceSelected = false;
 ds_device selectedDevice;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-04-26 Thread Kohei Yoshida
 opencl/source/openclwrapper.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit b4f341389ce7fa889e8a668be0233d1dbbd814c2
Author: Kohei Yoshida 
Date:   Tue Apr 25 22:24:04 2017 -0400

Revert the wrong "cleanup" change.

Introduced by 63df0796f5ec500f3b6fb34510d4bc79c009e76d.

Change-Id: I2481bcef144bd30571e69130d22f6d313dbddfea
Reviewed-on: https://gerrit.libreoffice.org/36968
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 8660dd744816..892c2dd1bcf0 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -791,7 +791,10 @@ void findDeviceInfoFromDeviceId(cl_device_id aDeviceId, 
size_t& rDeviceId, size_
 
 bool canUseOpenCL()
 {
-return !getenv("SAL_DISABLE_OPENCL") || 
!officecfg::Office::Common::Misc::UseOpenCL::get();
+if (getenv("SAL_DISABLE_OPENCL") || 
!officecfg::Office::Common::Misc::UseOpenCL::get())
+return false;
+
+return true;
 }
 
 bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool 
bForceEvaluation, OUString& rOutSelectedDeviceVersionIDString)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Jochen Nitschke
 opencl/source/openclwrapper.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 5301985417557627eb6e67cea26caf9688fd3920
Author: Jochen Nitschke 
Date:   Sun Jan 22 12:02:39 2017 +0100

cppcheck: memleak (false positive)

but manage ownership from start

Change-Id: I22d855d89bd93c56fbbcc1fb64e757fc950aa791
Reviewed-on: https://gerrit.libreoffice.org/33391
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 7b9d3ab..7962893 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -218,16 +218,15 @@ std::vector binaryGenerated( 
const char * clFileNam
 assert(pDevID == gpuEnv.mpDevID);
 
 OString fileName = createFileName(gpuEnv.mpDevID, clFileName);
-osl::File* pNewFile = new osl::File(rtl::OStringToOUString(fileName, 
RTL_TEXTENCODING_UTF8));
+auto pNewFile = 
std::make_shared(rtl::OStringToOUString(fileName, 
RTL_TEXTENCODING_UTF8));
 if(pNewFile->open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
 {
-aGeneratedFiles.push_back(std::shared_ptr(pNewFile));
+aGeneratedFiles.push_back(pNewFile);
 SAL_INFO("opencl.file", "Opening binary file '" << fileName << "' for 
reading: success");
 }
 else
 {
 SAL_INFO("opencl.file", "Opening binary file '" << fileName << "' for 
reading: FAIL");
-delete pNewFile;
 }
 
 return aGeneratedFiles;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-18 Thread Tomaž Vajngerl
 opencl/source/openclwrapper.cxx |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit baeb3b43fb67192e8e8639e2d5dd21ccbf5178a4
Author: Tomaž Vajngerl 
Date:   Tue Oct 11 13:01:01 2016 +0200

opencl: convert to C++11 for loop

Change-Id: Id96a3816eb7ef2241f5a6a57b164e1e366eb357a
Reviewed-on: https://gerrit.libreoffice.org/29693
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 3daa019..c876133 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -739,16 +739,14 @@ namespace {
 
 cl_device_id findDeviceIdByDeviceString(const OUString& rString, const 
std::vector& rPlatforms)
 {
-std::vector::const_iterator it = rPlatforms.begin(), 
itEnd = rPlatforms.end();
-for(; it != itEnd; ++it)
+for (const OpenCLPlatformInfo& rPlatform : rPlatforms)
 {
-std::vector::const_iterator itr = 
it->maDevices.begin(), itrEnd = it->maDevices.end();
-for(; itr != itrEnd; ++itr)
+for (const OpenCLDeviceInfo& rDeviceInfo : rPlatform.maDevices)
 {
-OUString aDeviceId = it->maVendor + " " + itr->maName;
-if(rString == aDeviceId)
+OUString aDeviceId = rDeviceInfo.maVendor + " " + 
rDeviceInfo.maName;
+if (rString == aDeviceId)
 {
-return static_cast(itr->device);
+return rDeviceInfo.device;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-29 Thread Tor Lillqvist
 opencl/source/opencl_device.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 68106cbac586f25836d3482c068eee2ffb7c99fc
Author: Tor Lillqvist 
Date:   Wed Jun 29 18:25:26 2016 +0300

Don't waste too much time evaluating the "score" for the "native CPU"

This code took tens of second typically, which is utterly pointless.
Instead run the loop for max a second, after which estimate how long
it would have taken to process all of the data.

Don't confuse the "native CPU" term here with a CPU-based device
of an actual OpenCL implementation. That is a completely different
thing. This "native CPU" thing here is just our way to estimate how
much time it takes to do calculations using normal C++ code on the
CPU.

Change-Id: I92f5eedc06bbaaef6a9b5322fefec9d41f0db505
Reviewed-on: https://gerrit.libreoffice.org/26774
Reviewed-by: Michael Meeks 
Tested-by: Jenkins 

diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index 0a0d28e..3dc9a29 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -327,7 +327,8 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, 
std::unique_ptroutputSize; j++)
+unsigned long j;
+for (j = 0; j < testData->outputSize; j++)
 {
 double fAverage = 0.0f;
 double fMin = DBL_MAX;
@@ -340,15 +341,25 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, 
std::unique_ptrinputSize;
 testData->output[j] = fAverage + (fMin * fSoP);
+// Don't run for much longer than one second
+if (j > 0 && j % 100 == 0)
+{
+rDevice.fTime = timerCurrent();
+if (rDevice.fTime >= 1)
+break;
+}
 }
 
+rDevice.fTime = timerCurrent();
+
+// Scale time to how long it would have taken to go all the way to 
outputSize
+rDevice.fTime /= ((double) j / testData->outputSize);
+
 // 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;
-
-rDevice.fTime = timerCurrent();
 rDevice.fTime *= fInterpretTailFactor;
 rDevice.bErrors = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-06 Thread Mark Hung
 opencl/source/opencl_device.cxx |   11 ---
 opencl/source/openclwrapper.cxx |2 ++
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 40b0b9ab7703a165295b008f47df14d2ec076fb1
Author: Mark Hung 
Date:   Fri May 13 19:58:18 2016 +0800

Ensure that OpenCL device id returned from getDeviceSelection() is valid.

Change-Id: I756bb57d471db3d3ca1d9c3733d359c7c16b4e66
Reviewed-on: https://gerrit.libreoffice.org/24959
Tested-by: Jenkins 
Reviewed-by: Mark Page 
Reviewed-by: Tomaž Vajngerl 

diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index bfe81b5..a653ac7 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -636,10 +636,15 @@ ds_device getDeviceSelection(
 }
 
 /* Final device selection */
-selectedDevice = aProfile->devices[bestDeviceIdx];
-bIsDeviceSelected = true;
+if (bestDeviceIdx >=0 && static_cast< 
std::vector::size_type> ( bestDeviceIdx ) < aProfile->devices.size() 
)
+{
+selectedDevice = aProfile->devices[bestDeviceIdx];
+bIsDeviceSelected = true;
 
-writeDevicesLog(aProfile, sProfilePath, bestDeviceIdx);
+writeDevicesLog(aProfile, sProfilePath, bestDeviceIdx);
+} else {
+selectedDevice.eType = DeviceType::NativeCPU;
+}
 }
 return selectedDevice;
 }
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 1655cb6..ab65091 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -703,6 +703,8 @@ bool switchOpenCLDevice(const OUString* pDevice, bool 
bAutoSelect, bool bForceEv
 OUString path;
 osl::FileBase::getSystemPathFromFileURL(url,path);
 ds_device aSelectedDevice = getDeviceSelection(path, bForceEvaluation);
+if ( aSelectedDevice.eType != DeviceType::OpenCLDevice)
+return false;
 pDeviceId = aSelectedDevice.aDeviceID;
 
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: opencl/source sc/source sd/source sfx2/source svx/source

2016-05-26 Thread Caolán McNamara
 opencl/source/opencl_device.cxx  |2 +-
 sc/source/ui/inc/docsh.hxx   |   16 
 sd/source/ui/view/viewshel.cxx   |2 +-
 sfx2/source/view/classificationcontroller.cxx|2 +-
 svx/source/sidebar/text/TextUnderlineControl.hxx |2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 3c65f07ede73105cca4b1b9597d6f8b02f226db9
Author: Caolán McNamara 
Date:   Thu May 26 11:58:25 2016 +0100

cppcheck: noExplicitConstructor

Change-Id: Ibb6bc9a17418a8fb0b5f882285088a5b80fd5beb

diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index db143e3..bfe81b5 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -465,7 +465,7 @@ class LogWriter
 private:
 SvFileStream maStream;
 public:
-LogWriter(OUString aFileName)
+explicit LogWriter(OUString aFileName)
 : maStream(aFileName, StreamMode::WRITE)
 {}
 
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 079b542..dcb4f9e 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -168,7 +168,7 @@ private:
 static void InitInterface_Impl();
 
 public:
-ScDocShell( const ScDocShell& rDocShell );
+explicitScDocShell( const ScDocShell& rDocShell );
 ScDocShell( const SfxModelFlags i_nSfxCreationFlags = 
SfxModelFlags::EMBEDDED_OBJECT );
 virtual ~ScDocShell();
 
@@ -448,18 +448,18 @@ typedef tools::SvRef ScDocShellRef;
  */
 class SC_DLLPUBLIC ScDocShellModificator
 {
-ScDocShell& rDocShell;
+ScDocShell& rDocShell;
 std::unique_ptr mpProtector;
-boolbAutoCalcShellDisabled;
-boolbIdleEnabled;
+boolbAutoCalcShellDisabled;
+boolbIdleEnabled;
 
-ScDocShellModificator( const 
ScDocShellModificator& ) = delete;
+ScDocShellModificator( const ScDocShellModificator& ) = delete;
 ScDocShellModificator&  operator=( const ScDocShellModificator& ) = delete;
 
 public:
-ScDocShellModificator( ScDocShell& );
-~ScDocShellModificator();
-voidSetDocumentModified();
+explicit ScDocShellModificator( ScDocShell& );
+~ScDocShellModificator();
+voidSetDocumentModified();
 };
 
 //#i97876# Spreadsheet data changes are not notified
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index c46b9ef..f76536b 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1240,7 +1240,7 @@ class KeepSlideSorterInSyncWithPageChanges
 sd::slidesorter::controller::SelectionObserver::Context m_aContext;
 
 public:
-KeepSlideSorterInSyncWithPageChanges(sd::slidesorter::SlideSorter& 
rSlideSorter)
+explicit 
KeepSlideSorterInSyncWithPageChanges(sd::slidesorter::SlideSorter& rSlideSorter)
 : m_aDrawLock(rSlideSorter)
 , m_aModelLock(rSlideSorter.GetController())
 , m_aUpdateLock(rSlideSorter)
diff --git a/sfx2/source/view/classificationcontroller.cxx 
b/sfx2/source/view/classificationcontroller.cxx
index 1e932c8..caa6ef4 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -90,7 +90,7 @@ class SAL_WARN_UNUSED ClassificationControl : public 
vcl::Window
 virtual void DataChanged(const DataChangedEvent& rEvent) override;
 
 public:
-ClassificationControl(vcl::Window* pParent);
+explicit ClassificationControl(vcl::Window* pParent);
 virtual ~ClassificationControl();
 virtual void dispose() override;
 virtual void Resize() override;
diff --git a/svx/source/sidebar/text/TextUnderlineControl.hxx 
b/svx/source/sidebar/text/TextUnderlineControl.hxx
index a28a212..333f039 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.hxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.hxx
@@ -32,7 +32,7 @@ namespace svx {
 class TextUnderlineControl : public SfxPopupWindow
 {
 public:
-TextUnderlineControl(sal_uInt16 nId);
+explicit TextUnderlineControl(sal_uInt16 nId);
 virtual ~TextUnderlineControl();
 virtual void dispose() override;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-03 Thread Noel Grandin
 opencl/source/opencl_device.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4fccc4376cd253648bf0dd1d49dd80bc76148f08
Author: Noel Grandin 
Date:   Wed Jan 27 11:06:31 2016 +0200

loplugin:fpcomparison in opencl/

Change-Id: Ia5b4a5010afd72ce59629dbc9b2045177a155182
Reviewed-on: https://gerrit.libreoffice.org/21867
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index 9a10d36..32a94df 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "opencl_device.hxx"
 
@@ -175,7 +176,7 @@ double timerCurrent(timer* mytimer)
 /* Random number generator */
 double random(double min, double max)
 {
-if (min == max)
+if (rtl::math::approxEqual(min, max))
 return min;
 return comphelper::rng::uniform_real_distribution(min, max);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-26 Thread Tor Lillqvist
 opencl/source/openclwrapper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0c76f53c83016064ad2cc569a4df176937478c98
Author: Tor Lillqvist t...@collabora.com
Date:   Wed Aug 26 15:05:22 2015 +0300

Revert Enable out-of-order kernel execution

Is not a good idea after all, says mmeeks. Plus, we should check if
the device actually supports it (with clGetDeviceInfo
(CL_DEVICE_QUEUE_PROPERTIES) before attempting to use it.

This reverts commit a4681be5347fe24867b4f603dc57942c3306227b.

Change-Id: I11896ab2d40bd8abcb11a21ce5df4eb75816013a

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 7b7d156..4da1ec7 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -788,7 +788,7 @@ bool switchOpenCLDevice(const OUString* pDevice, bool 
bAutoSelect, bool bForceEv
 for (int i = 0; i  OPENCL_CMDQUEUE_SIZE; ++i)
 {
 command_queue[i] = clCreateCommandQueue(
-context, pDeviceId, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 
nState);
+context, pDeviceId, 0, nState);
 if (nState != CL_SUCCESS)
 SAL_WARN(opencl, clCreateCommandQueue failed:   nState);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-26 Thread Tor Lillqvist
 opencl/source/openclwrapper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a81f59f83e7886c88bd1fbf1589848aa1297ab8f
Author: Tor Lillqvist t...@collabora.com
Date:   Wed Aug 26 15:16:40 2015 +0300

Log OpenCL errors symbolically here, too

Change-Id: I96ef317e974a9db1713ad3005d0efcecb2bacda5

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 4da1ec7..d6041e6 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -772,7 +772,7 @@ bool switchOpenCLDevice(const OUString* pDevice, bool 
bAutoSelect, bool bForceEv
 cps[2] = 0;
 cl_context context = clCreateContext( cps, 1, pDeviceId, NULL, NULL, 
nState );
 if (nState != CL_SUCCESS)
-SAL_WARN(opencl, clCreateContext failed:   nState);
+SAL_WARN(opencl, clCreateContext failed:   errorString(nState));
 
 if(nState != CL_SUCCESS || context == NULL)
 {
@@ -790,7 +790,7 @@ bool switchOpenCLDevice(const OUString* pDevice, bool 
bAutoSelect, bool bForceEv
 command_queue[i] = clCreateCommandQueue(
 context, pDeviceId, 0, nState);
 if (nState != CL_SUCCESS)
-SAL_WARN(opencl, clCreateCommandQueue failed:   nState);
+SAL_WARN(opencl, clCreateCommandQueue failed:   
errorString(nState));
 
 if (command_queue[i] == NULL || nState != CL_SUCCESS)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-17 Thread Kohei Yoshida
 opencl/source/openclwrapper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a4681be5347fe24867b4f603dc57942c3306227b
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Wed Dec 17 14:32:21 2014 -0500

Enable out-of-order kernel execution.

Change-Id: I4dbc69ca2618c37184ffdc217493e3880e149617

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 9ce2481..09e7bc0 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -762,7 +762,7 @@ bool switchOpenCLDevice(const OUString* pDevice, bool 
bAutoSelect, bool bForceEv
 }
 
 cl_command_queue command_queue = clCreateCommandQueue(
-context, pDeviceId, 0, nState);
+context, pDeviceId, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 
nState);
 
 if(command_queue == NULL || nState != CL_SUCCESS)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-11-27 Thread Tor Lillqvist
 opencl/source/openclconfig.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 79d6813609ffe05e4d8b678bc608fbfd1482aeb9
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Nov 27 15:41:49 2014 +0200

Use correct SAL_INFO log area

Change-Id: I47e6dcf18fe141b8dba33a8c3cd83f80950045cd

diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx
index aa7a07a..dd50649 100644
--- a/opencl/source/openclconfig.cxx
+++ b/opencl/source/openclconfig.cxx
@@ -159,12 +159,12 @@ bool match(const OpenCLConfig::ImplMatcherSet rList, 
const OpenCLPlatformInfo
 {
 for (auto i = rList.cbegin(); i != rList.end(); ++i)
 {
-SAL_INFO(sc.opencl, Looking for match for platform=  rPlatform 
 , device=  rDevice 
+SAL_INFO(opencl, Looking for match for platform=  rPlatform  
, device=  rDevice 
   in   sKindOfList   entry=  *i);
 
 if (match(*i, rPlatform, rDevice))
 {
-SAL_INFO(sc.opencl, Match!);
+SAL_INFO(opencl, Match!);
 return true;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits