IPPInitSingelton was added to contain IPP related global variables;

OPENCV_IPP env var now allows to select IPP architecture level for IPP9+;
IPP initialization logic was unified across modules;
This commit is contained in:
Pavel Vlasov
2015-09-25 18:00:53 +03:00
parent 34e4e66bf1
commit e837d69f8f
11 changed files with 318 additions and 42 deletions

View File

@@ -645,6 +645,7 @@ namespace cudev
namespace ipp
{
CV_EXPORTS int getIppFeatures();
CV_EXPORTS void setIppStatus(int status, const char * const funcname = NULL, const char * const filename = NULL,
int line = 0);
CV_EXPORTS int getIppStatus();

View File

@@ -256,6 +256,42 @@ static inline IppDataType ippiGetDataType(int depth)
#define HAVE_ICV 0
#endif
#if defined HAVE_IPP
#if IPP_VERSION_X100 >= 900
#define IPP_INITIALIZER(FEAT) \
{ \
if(FEAT) \
ippSetCpuFeatures(FEAT); \
else \
ippInit(); \
}
#elif IPP_VERSION_X100 >= 800
#define IPP_INITIALIZER(FEAT) \
{ \
ippInit(); \
}
#else
#define IPP_INITIALIZER(FEAT) \
{ \
ippStaticInit(); \
}
#endif
#ifdef CVAPI_EXPORTS
#define IPP_INITIALIZER_AUTO \
struct __IppInitializer__ \
{ \
__IppInitializer__() \
{IPP_INITIALIZER(cv::ipp::getIppFeatures())} \
}; \
static struct __IppInitializer__ __ipp_initializer__;
#else
#define IPP_INITIALIZER_AUTO
#endif
#else
#define IPP_INITIALIZER
#define IPP_INITIALIZER_AUTO
#endif
#define CV_IPP_CHECK_COND (cv::ipp::useIPP())
#define CV_IPP_CHECK() if(CV_IPP_CHECK_COND)