2012-03-15 22:36:01 +08:00
|
|
|
#include "perf_precomp.hpp"
|
2013-03-18 18:42:27 +08:00
|
|
|
#include "opencv2/ts/gpu_perf.hpp"
|
2012-03-15 22:36:01 +08:00
|
|
|
|
2013-06-20 19:16:22 +08:00
|
|
|
static const char * impls[] = {
|
2013-06-19 23:16:18 +08:00
|
|
|
#ifdef HAVE_CUDA
|
2013-06-20 19:16:22 +08:00
|
|
|
"cuda",
|
2014-02-02 22:24:21 +08:00
|
|
|
#endif
|
2014-03-14 02:35:08 +08:00
|
|
|
#ifdef HAVE_OPENCV_OCL
|
2014-02-02 22:24:21 +08:00
|
|
|
"ocl",
|
2013-06-19 23:16:18 +08:00
|
|
|
#endif
|
2013-06-20 19:16:22 +08:00
|
|
|
"plain"
|
|
|
|
};
|
|
|
|
|
2014-03-24 14:08:44 +08:00
|
|
|
#ifdef HAVE_OPENCL
|
|
|
|
#define DUMP_PROPERTY_XML(propertyName, propertyValue) \
|
|
|
|
do { \
|
|
|
|
std::stringstream ssName, ssValue;\
|
|
|
|
ssName << propertyName;\
|
|
|
|
ssValue << propertyValue; \
|
|
|
|
::testing::Test::RecordProperty(ssName.str(), ssValue.str()); \
|
|
|
|
} while (false)
|
|
|
|
|
|
|
|
#define DUMP_MESSAGE_STDOUT(msg) \
|
|
|
|
do { \
|
|
|
|
std::cout << msg << std::endl; \
|
|
|
|
} while (false)
|
|
|
|
|
|
|
|
#include "opencv2/ocl/private/opencl_dumpinfo.hpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
::perf::TestBase::setPerformanceStrategy(::perf::PERF_STRATEGY_SIMPLE);
|
2014-03-31 21:30:08 +08:00
|
|
|
#if defined(HAVE_CUDA) && defined(HAVE_OPENCL)
|
|
|
|
CV_PERF_TEST_MAIN_INTERNALS(nonfree, impls, perf::printCudaInfo(), dumpOpenCLDevice());
|
|
|
|
#elif defined(HAVE_CUDA)
|
2014-03-24 14:08:44 +08:00
|
|
|
CV_PERF_TEST_MAIN_INTERNALS(nonfree, impls, perf::printCudaInfo());
|
2014-03-25 17:16:42 +08:00
|
|
|
#elif defined(HAVE_OPENCL)
|
2014-03-24 14:08:44 +08:00
|
|
|
CV_PERF_TEST_MAIN_INTERNALS(nonfree, impls, dumpOpenCLDevice());
|
2014-03-25 17:16:42 +08:00
|
|
|
#else
|
2014-03-25 20:19:45 +08:00
|
|
|
CV_PERF_TEST_MAIN_INTERNALS(nonfree, impls)
|
2014-03-24 14:08:44 +08:00
|
|
|
#endif
|
|
|
|
}
|