added macro with ability of returning values

This commit is contained in:
Ilya Lavrenov
2014-01-27 12:32:26 +04:00
parent 06acf7090c
commit 321782b9b7
2 changed files with 21 additions and 15 deletions

View File

@@ -8,13 +8,13 @@
#ifdef HAVE_OPENCL
#ifdef CV_OPENCL_RUN_VERBOSE
#define CV_OCL_RUN(condition, func) \
#define CV_OCL_RUN_(condition, func, ...) \
{ \
if (cv::ocl::useOpenCL() && (condition) && func) \
{ \
printf("%s: OpenCL implementation is running\n", CV_Func); \
fflush(stdout); \
return; \
return __VA_ARGS__; \
} \
else \
{ \
@@ -23,11 +23,13 @@
} \
}
#else
#define CV_OCL_RUN(condition, func) \
#define CV_OCL_RUN_(condition, func, ...) \
if (cv::ocl::useOpenCL() && (condition) && func) \
return;
return __VA_ARGS__;
#endif
#else
#define CV_OCL_RUN(condition, func)
#define CV_OCL_RUN_(condition, func, retval)
#endif
#define CV_OCL_RUN(condition, func) CV_OCL_RUN_(condition, func)