summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-06-16 17:55:11 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-06-17 13:35:36 +0100
commitcab3e22562bcb5967f269524e1f9e285688bb121 (patch)
treedaa2f15e584a094db61471ebe6b775f0f755bfb9
parentf01985a22bc7d6d37a8c92e50b531e849705fd09 (diff)
OpenCL code cleanups
Change-Id: Iab75b11f13856a6e631587e22b5d76977b8c7448
-rw-r--r--RepositoryExternal.mk2
-rw-r--r--configure.ac4
-rw-r--r--sc/CppunitTest_sc_ucalc.mk3
-rw-r--r--sc/source/core/opencl/openclwrapper.cxx5
4 files changed, 8 insertions, 6 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 1cbfa3ccb2b7..16fd64307250 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -29,7 +29,7 @@
# External headers
-ifeq ($(ENABLE_OPENGCL),TRUE)
+ifeq ($(ENABLE_OPENCL),TRUE)
define gb_LinkTarget__use_opencl
$(call gb_LinkTarget_set_include,$(1),\
diff --git a/configure.ac b/configure.ac
index c4529f607784..4efc4f947bff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9756,8 +9756,8 @@ if test "z$with_opencl_sdk" = "z"; then
else
if test -d $with_opencl_sdk/include; then
ENABLE_OPENCL=TRUE
- OPENCL_CFLAGS="-I $with_opencl_sdk/include"
- OPENCL_LIBS="-L $with_opencl_sdk/lib/x86 -lOpenCL"
+ OPENCL_CFLAGS="-I$with_opencl_sdk/include"
+ OPENCL_LIBS="-L$with_opencl_sdk/lib/x86 -lOpenCL"
AC_MSG_RESULT([found at path $with_opencl_sdk])
else
AC_MSG_ERROR([no headers found found at $with_opencl_sdk/include ])
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);