<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
FYI, this change<br>
<br>
 double random(double min, double max)<br>
 {<br>
-    return floor(((double)rand() / ((unsigned int)RAND_MAX + 1)) * (max - min + 1) + min);<br>
+    return comphelper::rng::uniform_real_distribution(min, max);<br>
 }<br>
<br>
in sc/source/core/opencl/opencl_device.cxx has made the opencl cppunit<br>
test run extremely slow, if not hanging. </blockquote><div><br></div><div>The problem was that it called  <span style="font-size:13px;font-family:arial,sans-serif">comphelper::rng::uniform_real_</span><span style="font-size:13px;font-family:arial,sans-serif">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 </span><font face="arial, sans-serif">4bb67e666b2ca36a5caa5c3f22d0f1e802db527e and 1b226b02471f2fab5e5e6f79b6593636274d2320 .</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">--tml</font></div><div><font face="arial, sans-serif"><br></font></div></div></div></div>