Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
b37387ef
Commit
b37387ef
authored
Oct 02, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5425 from lupustr3:pvlasov/ipp_initialization_changes
parents
d69b7c33
6a0d3b06
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
317 additions
and
42 deletions
+317
-42
main.cpp
modules/calib3d/src/main.cpp
+52
-0
base.hpp
modules/core/include/opencv2/core/base.hpp
+1
-0
private.hpp
modules/core/include/opencv2/core/private.hpp
+36
-0
system.cpp
modules/core/src/system.cpp
+72
-29
main.cpp
modules/features2d/src/main.cpp
+52
-0
color.cpp
modules/imgproc/src/color.cpp
+0
-1
deriv.cpp
modules/imgproc/src/deriv.cpp
+0
-4
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+0
-4
main.cpp
modules/imgproc/src/main.cpp
+52
-0
sumpixels.cpp
modules/imgproc/src/sumpixels.cpp
+0
-4
main.cpp
modules/objdetect/src/main.cpp
+52
-0
No files found.
modules/calib3d/src/main.cpp
0 → 100644
View file @
b37387ef
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
//
// Library initialization file
//
#include "precomp.hpp"
IPP_INITIALIZER_AUTO
/* End of file. */
modules/core/include/opencv2/core/base.hpp
View file @
b37387ef
...
@@ -645,6 +645,7 @@ namespace cudev
...
@@ -645,6 +645,7 @@ namespace cudev
namespace
ipp
namespace
ipp
{
{
CV_EXPORTS
int
getIppFeatures
();
CV_EXPORTS
void
setIppStatus
(
int
status
,
const
char
*
const
funcname
=
NULL
,
const
char
*
const
filename
=
NULL
,
CV_EXPORTS
void
setIppStatus
(
int
status
,
const
char
*
const
funcname
=
NULL
,
const
char
*
const
filename
=
NULL
,
int
line
=
0
);
int
line
=
0
);
CV_EXPORTS
int
getIppStatus
();
CV_EXPORTS
int
getIppStatus
();
...
...
modules/core/include/opencv2/core/private.hpp
View file @
b37387ef
...
@@ -256,6 +256,42 @@ static inline IppDataType ippiGetDataType(int depth)
...
@@ -256,6 +256,42 @@ static inline IppDataType ippiGetDataType(int depth)
#define HAVE_ICV 0
#define HAVE_ICV 0
#endif
#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_COND (cv::ipp::useIPP())
#define CV_IPP_CHECK() if(CV_IPP_CHECK_COND)
#define CV_IPP_CHECK() if(CV_IPP_CHECK_COND)
...
...
modules/core/src/system.cpp
View file @
b37387ef
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
//M*/
//M*/
#include "precomp.hpp"
#include "precomp.hpp"
#include <iostream>
namespace
cv
{
namespace
cv
{
...
@@ -377,21 +378,6 @@ bool checkHardwareSupport(int feature)
...
@@ -377,21 +378,6 @@ bool checkHardwareSupport(int feature)
volatile
bool
useOptimizedFlag
=
true
;
volatile
bool
useOptimizedFlag
=
true
;
#ifdef HAVE_IPP
struct
IPPInitializer
{
IPPInitializer
(
void
)
{
#if IPP_VERSION_MAJOR >= 8
ippInit
();
#else
ippStaticInit
();
#endif
}
};
IPPInitializer
ippInitializer
;
#endif
volatile
bool
USE_SSE2
=
featuresEnabled
.
have
[
CV_CPU_SSE2
];
volatile
bool
USE_SSE2
=
featuresEnabled
.
have
[
CV_CPU_SSE2
];
volatile
bool
USE_SSE4_2
=
featuresEnabled
.
have
[
CV_CPU_SSE4_2
];
volatile
bool
USE_SSE4_2
=
featuresEnabled
.
have
[
CV_CPU_SSE4_2
];
...
@@ -1305,26 +1291,87 @@ void setUseCollection(bool flag)
...
@@ -1305,26 +1291,87 @@ void setUseCollection(bool flag)
namespace
ipp
namespace
ipp
{
{
static
int
ippStatus
=
0
;
// 0 - all is ok, -1 - IPP functions failed
struct
IPPInitSingelton
static
const
char
*
funcname
=
NULL
,
*
filename
=
NULL
;
{
static
int
linen
=
0
;
public
:
IPPInitSingelton
()
{
useIPP
=
true
;
ippStatus
=
0
;
funcname
=
NULL
;
filename
=
NULL
;
linen
=
0
;
ippFeatures
=
0
;
#ifdef HAVE_IPP
const
char
*
pIppEnv
=
getenv
(
"OPENCV_IPP"
);
cv
::
String
env
=
pIppEnv
;
if
(
env
.
size
())
{
if
(
env
==
"disabled"
)
{
std
::
cerr
<<
"WARNING: IPP was disabled by OPENCV_IPP environment variable"
<<
std
::
endl
;
useIPP
=
false
;
}
#if IPP_VERSION_X100 >= 900
else
if
(
env
==
"sse"
)
ippFeatures
=
ippCPUID_SSE
;
else
if
(
env
==
"sse2"
)
ippFeatures
=
ippCPUID_SSE2
;
else
if
(
env
==
"sse42"
)
ippFeatures
=
ippCPUID_SSE42
;
else
if
(
env
==
"avx"
)
ippFeatures
=
ippCPUID_AVX
;
else
if
(
env
==
"avx2"
)
ippFeatures
=
ippCPUID_AVX2
;
#endif
else
std
::
cerr
<<
"ERROR: Improper value of OPENCV_IPP: "
<<
env
.
c_str
()
<<
std
::
endl
;
}
IPP_INITIALIZER
(
ippFeatures
)
#endif
}
bool
useIPP
;
int
ippStatus
;
// 0 - all is ok, -1 - IPP functions failed
const
char
*
funcname
;
const
char
*
filename
;
int
linen
;
int
ippFeatures
;
};
static
IPPInitSingelton
&
getIPPSingelton
()
{
CV_SINGLETON_LAZY_INIT_REF
(
IPPInitSingelton
,
new
IPPInitSingelton
())
}
int
getIppFeatures
()
{
#ifdef HAVE_IPP
return
getIPPSingelton
().
ippFeatures
;
#else
return
0
;
#endif
}
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
)
{
{
ippStatus
=
status
;
getIPPSingelton
().
ippStatus
=
status
;
funcname
=
_funcname
;
getIPPSingelton
().
funcname
=
_funcname
;
filename
=
_filename
;
getIPPSingelton
().
filename
=
_filename
;
linen
=
_line
;
getIPPSingelton
().
linen
=
_line
;
}
}
int
getIppStatus
()
int
getIppStatus
()
{
{
return
ippStatus
;
return
getIPPSingelton
().
ippStatus
;
}
}
String
getIppErrorLocation
()
String
getIppErrorLocation
()
{
{
return
format
(
"%s:%d %s"
,
filename
?
filename
:
""
,
linen
,
funcname
?
funcname
:
""
);
return
format
(
"%s:%d %s"
,
getIPPSingelton
().
filename
?
getIPPSingelton
().
filename
:
""
,
getIPPSingelton
().
linen
,
getIPPSingelton
().
funcname
?
getIPPSingelton
().
funcname
:
""
);
}
}
bool
useIPP
()
bool
useIPP
()
...
@@ -1333,11 +1380,7 @@ bool useIPP()
...
@@ -1333,11 +1380,7 @@ bool useIPP()
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
if
(
data
->
useIPP
<
0
)
if
(
data
->
useIPP
<
0
)
{
{
const
char
*
pIppEnv
=
getenv
(
"OPENCV_IPP"
);
data
->
useIPP
=
getIPPSingelton
().
useIPP
;
if
(
pIppEnv
&&
(
cv
::
String
(
pIppEnv
)
==
"disabled"
))
data
->
useIPP
=
false
;
else
data
->
useIPP
=
true
;
}
}
return
(
data
->
useIPP
>
0
);
return
(
data
->
useIPP
>
0
);
#else
#else
...
...
modules/features2d/src/main.cpp
0 → 100644
View file @
b37387ef
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
//
// Library initialization file
//
#include "precomp.hpp"
IPP_INITIALIZER_AUTO
/* End of file. */
modules/imgproc/src/color.cpp
View file @
b37387ef
...
@@ -100,7 +100,6 @@
...
@@ -100,7 +100,6 @@
#define MAX_IPP8u 255
#define MAX_IPP8u 255
#define MAX_IPP16u 65535
#define MAX_IPP16u 65535
#define MAX_IPP32f 1.0
#define MAX_IPP32f 1.0
static
IppStatus
sts
=
ippInit
();
#endif
#endif
namespace
cv
namespace
cv
...
...
modules/imgproc/src/deriv.cpp
View file @
b37387ef
...
@@ -43,10 +43,6 @@
...
@@ -43,10 +43,6 @@
#include "precomp.hpp"
#include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencl_kernels_imgproc.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
static
IppStatus
sts
=
ippInit
();
#endif
/****************************************************************************************\
/****************************************************************************************\
Sobel & Scharr Derivative Filters
Sobel & Scharr Derivative Filters
\****************************************************************************************/
\****************************************************************************************/
...
...
modules/imgproc/src/imgwarp.cpp
View file @
b37387ef
...
@@ -50,10 +50,6 @@
...
@@ -50,10 +50,6 @@
#include "precomp.hpp"
#include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencl_kernels_imgproc.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
static
IppStatus
sts
=
ippInit
();
#endif
namespace
cv
namespace
cv
{
{
#if IPP_VERSION_X100 >= 710
#if IPP_VERSION_X100 >= 710
...
...
modules/imgproc/src/main.cpp
0 → 100644
View file @
b37387ef
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
//
// Library initialization file
//
#include "precomp.hpp"
IPP_INITIALIZER_AUTO
/* End of file. */
modules/imgproc/src/sumpixels.cpp
View file @
b37387ef
...
@@ -44,10 +44,6 @@
...
@@ -44,10 +44,6 @@
#include "precomp.hpp"
#include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencl_kernels_imgproc.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
static
IppStatus
sts
=
ippInit
();
#endif
namespace
cv
namespace
cv
{
{
...
...
modules/objdetect/src/main.cpp
0 → 100644
View file @
b37387ef
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
//
// Library initialization file
//
#include "precomp.hpp"
IPP_INITIALIZER_AUTO
/* End of file. */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment