Kaydet (Commit) cab3e225 authored tarafından Michael Meeks's avatar Michael Meeks

OpenCL code cleanups

Change-Id: Iab75b11f13856a6e631587e22b5d76977b8c7448
üst f01985a2
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# External headers # External headers
ifeq ($(ENABLE_OPENGCL),TRUE) ifeq ($(ENABLE_OPENCL),TRUE)
define gb_LinkTarget__use_opencl define gb_LinkTarget__use_opencl
$(call gb_LinkTarget_set_include,$(1),\ $(call gb_LinkTarget_set_include,$(1),\
......
...@@ -9756,8 +9756,8 @@ if test "z$with_opencl_sdk" = "z"; then ...@@ -9756,8 +9756,8 @@ if test "z$with_opencl_sdk" = "z"; then
else else
if test -d $with_opencl_sdk/include; then if test -d $with_opencl_sdk/include; then
ENABLE_OPENCL=TRUE ENABLE_OPENCL=TRUE
OPENCL_CFLAGS="-I $with_opencl_sdk/include" OPENCL_CFLAGS="-I$with_opencl_sdk/include"
OPENCL_LIBS="-L $with_opencl_sdk/lib/x86 -lOpenCL" OPENCL_LIBS="-L$with_opencl_sdk/lib/x86 -lOpenCL"
AC_MSG_RESULT([found at path $with_opencl_sdk]) AC_MSG_RESULT([found at path $with_opencl_sdk])
else else
AC_MSG_ERROR([no headers found found at $with_opencl_sdk/include ]) AC_MSG_ERROR([no headers found found at $with_opencl_sdk/include ])
......
...@@ -20,6 +20,9 @@ $(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc,sc)) ...@@ -20,6 +20,9 @@ $(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc,sc))
ifeq ($(ENABLE_TELEPATHY),TRUE) ifeq ($(ENABLE_TELEPATHY),TRUE)
$(eval $(call gb_CppunitTest_use_libraries,sc_ucalc,tubes)) $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc,tubes))
endif endif
ifeq ($(ENABLE_OPENCL),TRUE)
$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,opencl))
endif
$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\ $(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
boost_headers \ boost_headers \
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "random.hxx"
#include "openclwrapper.hxx" #include "openclwrapper.hxx"
#include "oclkernels.hxx" #include "oclkernels.hxx"
...@@ -1003,10 +1004,8 @@ double OclCalc::OclProcess(cl_kernel_function function, double *data, ...@@ -1003,10 +1004,8 @@ double OclCalc::OclProcess(cl_kernel_function function, double *data,
double OclCalc::OclTest() { double OclCalc::OclTest() {
double data[NUM]; double data[NUM];
srand((unsigned int) time(NULL));
for (int i = 0; i < NUM; i++) { 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]); fprintf(stderr, "%f\t", data[i]);
} }
OclProcess(&OclFormulax, data, AVG); OclProcess(&OclFormulax, data, AVG);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment