added new macros useful for tracking whether OpenCL impl run or not

This commit is contained in:
Ilya Lavrenov
2014-01-22 15:51:28 +04:00
parent ee88cc2c52
commit cc514ac7a9
3 changed files with 69 additions and 27 deletions

View File

@@ -0,0 +1,34 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
#ifdef HAVE_OPENCL
#ifdef CV_OPENCL_RUN_VERBOSE
#define CV_OCL_RUN(condition, func) \
{ \
if (cv::ocl::useOpenCL() && (condition) && func) \
{ \
printf("%s: OpenCL implementation is running\n", CV_Func); \
fflush(stdout); \
return; \
} \
else \
{ \
printf("%s: Plain implementation is running\n", CV_Func); \
fflush(stdout); \
} \
}
#else
#define CV_OCL_RUN(condition, func) \
if (cv::ocl::useOpenCL() && (condition) && func) \
return;
#endif
#else
#define CV_OCL_RUN(condition, func)
#endif