summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/opencl
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-04-02 06:24:05 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-04-02 06:24:05 +0000
commita6d8c8ff0c7d48e5e56728e3dc191ccb0a96418a (patch)
tree428cfc3b43089d16f2fb91699471d4a9949496d6 /sca-cpp/trunk/modules/opencl
parent86b27d2bb7203724cf25cd134b2b4e1cefeacb42 (diff)
Add more fine grain debug options and remove overhead in debug log macros when logging is turned off.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1308248 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/opencl')
-rw-r--r--sca-cpp/trunk/modules/opencl/eval.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/opencl/eval.hpp b/sca-cpp/trunk/modules/opencl/eval.hpp
index 35eb6a3b3b..82706ff0f2 100644
--- a/sca-cpp/trunk/modules/opencl/eval.hpp
+++ b/sca-cpp/trunk/modules/opencl/eval.hpp
@@ -47,11 +47,11 @@ const string clError(const cl_int e) {
return str(s);
}
-#ifdef WANT_MAINTAINER_MODE
-
/**
* OpenCL profiling counters.
*/
+#ifdef WANT_MAINTAINER_OPENCL_PROF
+
cl_ulong memtime = 0;
cl_ulong kernelqtime = 0;
cl_ulong kerneltime = 0;
@@ -209,7 +209,7 @@ public:
for (cl_uint i = 0; i < ndevs; i++) {
cl_int cqerr;
-#ifdef WANT_MAINTAINER_MODE
+#ifdef WANT_MAINTAINER_OPENCL_PROF
cq[i] = clCreateCommandQueue(ctx, devid[i], CL_QUEUE_PROFILING_ENABLE, &cqerr);
#else
cq[i] = clCreateCommandQueue(ctx, devid[i], 0, &cqerr);
@@ -594,7 +594,7 @@ const failable<OpenCLKernel> createKernel(const value& expr, const OpenCLProgram
*/
const failable<value> evalKernel(const failable<OpenCLKernel>& fkernel, const value& expr, const size_t gwsize, const value::ValueType type, const size_t n, const OpenCLContext& cl) {
-#ifdef WANT_MAINTAINER_MODE
+#ifdef WANT_MAINTAINER_OPENCL_PROF
const cl_uint estart = (cl_uint)timens();
const cl_uint pstart = estart;
#endif
@@ -643,7 +643,7 @@ const failable<value> evalKernel(const failable<OpenCLKernel>& fkernel, const va
return mkfailure<value>(string("Couldn't read from OpenCL device memory: ") + clError(rerr));
}
-#ifdef WANT_MAINTAINER_MODE
+#ifdef WANT_MAINTAINER_OPENCL_PROF
const cl_uint pend = (cl_uint)timens();
preptime += (pend - pstart);
#endif
@@ -656,7 +656,7 @@ const failable<value> evalKernel(const failable<OpenCLKernel>& fkernel, const va
return mkfailure<value>(string("Couldn't wait for kernel completion: ") + clError(werr));
}
-#ifdef WANT_MAINTAINER_MODE
+#ifdef WANT_MAINTAINER_OPENCL_PROF
profileMemEvents(nwevt, wevt);
profileKernelEvent(kevt);
profileMemEvent(revt);
@@ -669,7 +669,7 @@ const failable<value> evalKernel(const failable<OpenCLKernel>& fkernel, const va
clReleaseEvent(revt);
clReleaseEvent(kevt);
-#ifdef WANT_MAINTAINER_MODE
+#ifdef WANT_MAINTAINER_OPENCL_PROF
const cl_uint eend = (cl_uint)timens();
evaltime += (eend - estart);
#endif