Merge pull request #7102 from lupustr3:pvlasov/ipp_switch_fix

This commit is contained in:
Alexander Alekhin 2016-08-12 10:39:44 +00:00
commit 1fb1088b7d

View File

@ -1303,10 +1303,10 @@ void setUseCollection(bool flag)
namespace ipp namespace ipp
{ {
struct IPPInitSingelton struct IPPInitSingleton
{ {
public: public:
IPPInitSingelton() IPPInitSingleton()
{ {
useIPP = true; useIPP = true;
ippStatus = 0; ippStatus = 0;
@ -1360,15 +1360,15 @@ public:
int ippFeatures; int ippFeatures;
}; };
static IPPInitSingelton& getIPPSingelton() static IPPInitSingleton& getIPPSingleton()
{ {
CV_SINGLETON_LAZY_INIT_REF(IPPInitSingelton, new IPPInitSingelton()) CV_SINGLETON_LAZY_INIT_REF(IPPInitSingleton, new IPPInitSingleton())
} }
int getIppFeatures() int getIppFeatures()
{ {
#ifdef HAVE_IPP #ifdef HAVE_IPP
return getIPPSingelton().ippFeatures; return getIPPSingleton().ippFeatures;
#else #else
return 0; return 0;
#endif #endif
@ -1376,20 +1376,20 @@ int getIppFeatures()
void setIppStatus(int status, const char * const _funcname, const char * const _filename, int _line) void setIppStatus(int status, const char * const _funcname, const char * const _filename, int _line)
{ {
getIPPSingelton().ippStatus = status; getIPPSingleton().ippStatus = status;
getIPPSingelton().funcname = _funcname; getIPPSingleton().funcname = _funcname;
getIPPSingelton().filename = _filename; getIPPSingleton().filename = _filename;
getIPPSingelton().linen = _line; getIPPSingleton().linen = _line;
} }
int getIppStatus() int getIppStatus()
{ {
return getIPPSingelton().ippStatus; return getIPPSingleton().ippStatus;
} }
String getIppErrorLocation() String getIppErrorLocation()
{ {
return format("%s:%d %s", getIPPSingelton().filename ? getIPPSingelton().filename : "", getIPPSingelton().linen, getIPPSingelton().funcname ? getIPPSingelton().funcname : ""); return format("%s:%d %s", getIPPSingleton().filename ? getIPPSingleton().filename : "", getIPPSingleton().linen, getIPPSingleton().funcname ? getIPPSingleton().funcname : "");
} }
bool useIPP() bool useIPP()
@ -1398,7 +1398,7 @@ bool useIPP()
CoreTLSData* data = getCoreTlsData().get(); CoreTLSData* data = getCoreTlsData().get();
if(data->useIPP < 0) if(data->useIPP < 0)
{ {
data->useIPP = getIPPSingelton().useIPP; data->useIPP = getIPPSingleton().useIPP;
} }
return (data->useIPP > 0); return (data->useIPP > 0);
#else #else
@ -1410,7 +1410,7 @@ void setUseIPP(bool flag)
{ {
CoreTLSData* data = getCoreTlsData().get(); CoreTLSData* data = getCoreTlsData().get();
#ifdef HAVE_IPP #ifdef HAVE_IPP
data->useIPP = flag; data->useIPP = (getIPPSingleton().useIPP)?flag:false;
#else #else
(void)flag; (void)flag;
data->useIPP = false; data->useIPP = false;