Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


FYI, this change

 double random(double min, double max)
 {
-    return floor(((double)rand() / ((unsigned int)RAND_MAX + 1)) * (max -
min + 1) + min);
+    return comphelper::rng::uniform_real_distribution(min, max);
 }

in sc/source/core/opencl/opencl_device.cxx has made the opencl cppunit
test run extremely slow, if not hanging.


The problem was that it called  comphelper::rng::uniform_real_distribution()
with two equal arguments, which is invalid use of that API, and causes the
current implementation to get stuck in a loop in the boost code. (I didn't
bother checking whether it is possible that the loop eventually will exit.)
Fixed with 4bb67e666b2ca36a5caa5c3f22d0f1e802db527e
and 1b226b02471f2fab5e5e6f79b6593636274d2320 .

--tml

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.