diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-06-16 17:55:11 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-06-17 13:35:36 +0100 |
commit | cab3e22562bcb5967f269524e1f9e285688bb121 (patch) | |
tree | daa2f15e584a094db61471ebe6b775f0f755bfb9 /sc | |
parent | f01985a22bc7d6d37a8c92e50b531e849705fd09 (diff) |
OpenCL code cleanups
Change-Id: Iab75b11f13856a6e631587e22b5d76977b8c7448
Diffstat (limited to 'sc')
-rw-r--r-- | sc/CppunitTest_sc_ucalc.mk | 3 | ||||
-rw-r--r-- | sc/source/core/opencl/openclwrapper.cxx | 5 |
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); |