summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/CppunitTest_sc_ucalc.mk3
-rw-r--r--sc/source/core/opencl/openclwrapper.cxx5
2 files changed, 5 insertions, 3 deletions
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 0933cb58cd1e..68d6cb5d3bf0 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -20,6 +20,9 @@ $(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc,sc))
ifeq ($(ENABLE_TELEPATHY),TRUE)
$(eval $(call gb_CppunitTest_use_libraries,sc_ucalc,tubes))
endif
+ifeq ($(ENABLE_OPENCL),TRUE)
+$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,opencl))
+endif
$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
boost_headers \
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 05b169a5f9c7..6c3935edc51f 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
+#include "random.hxx"
#include "openclwrapper.hxx"
#include "oclkernels.hxx"
@@ -1003,10 +1004,8 @@ double OclCalc::OclProcess(cl_kernel_function function, double *data,
double OclCalc::OclTest() {
double data[NUM];
- srand((unsigned int) time(NULL));
-
for (int i = 0; i < NUM; i++) {
- data[i] = rand() / (RAND_MAX + 1.0);
+ data[i] = sc::rng::uniform();
fprintf(stderr, "%f\t", data[i]);
}
OclProcess(&OclFormulax, data, AVG);