ocl: fix mac and superres test
This commit is contained in:
parent
43e4946cca
commit
b1ac35e14a
@ -6,6 +6,17 @@
|
|||||||
#if defined(HAVE_OPENCL_STATIC)
|
#if defined(HAVE_OPENCL_STATIC)
|
||||||
|
|
||||||
#if defined __APPLE__
|
#if defined __APPLE__
|
||||||
|
// APPLE ignores CL_USE_DEPRECATED_OPENCL_1_1_APIS so use this hack:
|
||||||
|
#include <OpenCL/cl_platform.h>
|
||||||
|
#ifdef CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||||
|
#undef CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||||
|
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||||
|
#endif
|
||||||
|
#ifdef CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
|
||||||
|
#undef CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
|
||||||
|
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <OpenCL/cl.h>
|
#include <OpenCL/cl.h>
|
||||||
#else
|
#else
|
||||||
#include <CL/cl.h>
|
#include <CL/cl.h>
|
||||||
|
@ -278,6 +278,16 @@ TEST_F(SuperResolution, BTVL1_GPU)
|
|||||||
#if defined(HAVE_OPENCV_OCL) && defined(HAVE_OPENCL)
|
#if defined(HAVE_OPENCV_OCL) && defined(HAVE_OPENCL)
|
||||||
TEST_F(SuperResolution, BTVL1_OCL)
|
TEST_F(SuperResolution, BTVL1_OCL)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
const cv::ocl::DeviceInfo& dev = cv::ocl::Context::getContext()->getDeviceInfo();
|
||||||
|
std::cout << "Device name:" << dev.deviceName << std::endl;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cout << "Device name: N/A" << std::endl;
|
||||||
|
return; // skip test
|
||||||
|
}
|
||||||
RunTest(cv::superres::createSuperResolution_BTVL1_OCL());
|
RunTest(cv::superres::createSuperResolution_BTVL1_OCL());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user