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
9997e6d3
Commit
9997e6d3
authored
Mar 19, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3823 from lupustr3:pvlasov/implementation_detector_update
parents
e92645c5
08540934
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
30 deletions
+47
-30
utility.hpp
modules/core/include/opencv2/core/utility.hpp
+1
-1
precomp.hpp
modules/core/src/precomp.hpp
+19
-11
system.cpp
modules/core/src/system.cpp
+27
-18
No files found.
modules/core/include/opencv2/core/utility.hpp
View file @
9997e6d3
...
...
@@ -61,7 +61,7 @@ CV_EXPORTS void addImpl(int flag, const char* func = 0); // add implementation a
// Each implementation entry correspond to function name entry, so you can find which implementation was executed in which fucntion
CV_EXPORTS
int
getImpl
(
std
::
vector
<
int
>
&
impl
,
std
::
vector
<
String
>
&
funName
);
CV_EXPORTS
bool
useCollection
();
// return implementation col
el
ction state
CV_EXPORTS
bool
useCollection
();
// return implementation col
le
ction state
CV_EXPORTS
void
setUseCollection
(
bool
flag
);
// set implementation collection state
#define CV_IMPL_PLAIN 0x01 // native CPU OpenCV implementation
...
...
modules/core/src/precomp.hpp
View file @
9997e6d3
...
...
@@ -232,15 +232,30 @@ inline bool checkScalar(InputArray sc, int atype, int sckind, int akind)
void
convertAndUnrollScalar
(
const
Mat
&
sc
,
int
buftype
,
uchar
*
scbuf
,
size_t
blocksize
);
#ifdef CV_COLLECT_IMPL_DATA
struct
ImplCollector
{
ImplCollector
()
{
useCollection
=
false
;
implFlags
=
0
;
}
bool
useCollection
;
// enable/disable impl data collection
int
implFlags
;
std
::
vector
<
int
>
implCode
;
std
::
vector
<
String
>
implFun
;
cv
::
Mutex
mutex
;
};
#endif
struct
CoreTLSData
{
CoreTLSData
()
:
device
(
0
),
useOpenCL
(
-
1
),
useIPP
(
-
1
)
,
useCollection
(
false
)
CoreTLSData
()
:
device
(
0
),
useOpenCL
(
-
1
),
useIPP
(
-
1
)
{
#ifdef HAVE_TEGRA_OPTIMIZATION
useTegra
=
-
1
;
#endif
#ifdef CV_COLLECT_IMPL_DATA
implFlags
=
0
;
#endif
}
...
...
@@ -251,13 +266,6 @@ struct CoreTLSData
int
useIPP
;
// 1 - use, 0 - do not use, -1 - auto/not initialized
#ifdef HAVE_TEGRA_OPTIMIZATION
int
useTegra
;
// 1 - use, 0 - do not use, -1 - auto/not initialized
#endif
bool
useCollection
;
// enable/disable impl data collection
#ifdef CV_COLLECT_IMPL_DATA
int
implFlags
;
std
::
vector
<
int
>
implCode
;
std
::
vector
<
String
>
implFun
;
#endif
};
...
...
modules/core/src/system.cpp
View file @
9997e6d3
...
...
@@ -1163,47 +1163,56 @@ TLSData<CoreTLSData>& getCoreTlsData()
#ifdef CV_COLLECT_IMPL_DATA
ImplCollector
&
getImplData
()
{
static
ImplCollector
*
value
=
new
ImplCollector
();
return
*
value
;
}
void
setImpl
(
int
flags
)
{
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
data
->
implFlags
=
flags
;
data
->
implCode
.
clear
();
data
->
implFun
.
clear
();
cv
::
AutoLock
lock
(
getImplData
().
mutex
);
getImplData
().
implFlags
=
flags
;
getImplData
().
implCode
.
clear
();
getImplData
().
implFun
.
clear
();
}
void
addImpl
(
int
flag
,
const
char
*
func
)
{
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
data
->
implFlags
|=
flag
;
cv
::
AutoLock
lock
(
getImplData
().
mutex
);
getImplData
().
implFlags
|=
flag
;
if
(
func
)
// use lazy collection if name was not specified
{
size_t
index
=
data
->
implCode
.
size
();
if
(
!
index
||
(
data
->
implCode
[
index
-
1
]
!=
flag
||
data
->
implFun
[
index
-
1
].
compare
(
func
)))
// avoid duplicates
size_t
index
=
getImplData
().
implCode
.
size
();
if
(
!
index
||
(
getImplData
().
implCode
[
index
-
1
]
!=
flag
||
getImplData
().
implFun
[
index
-
1
].
compare
(
func
)))
// avoid duplicates
{
data
->
implCode
.
push_back
(
flag
);
data
->
implFun
.
push_back
(
func
);
getImplData
().
implCode
.
push_back
(
flag
);
getImplData
().
implFun
.
push_back
(
func
);
}
}
}
int
getImpl
(
std
::
vector
<
int
>
&
impl
,
std
::
vector
<
String
>
&
funName
)
{
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
impl
=
data
->
implCode
;
funName
=
data
->
implFun
;
return
data
->
implFlags
;
// return actual flags for lazy collection
cv
::
AutoLock
lock
(
getImplData
().
mutex
);
impl
=
getImplData
().
implCode
;
funName
=
getImplData
().
implFun
;
return
getImplData
().
implFlags
;
// return actual flags for lazy collection
}
bool
useCollection
()
{
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
return
data
->
useCollection
;
return
getImplData
().
useCollection
;
}
void
setUseCollection
(
bool
flag
)
{
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
data
->
useCollection
=
flag
;
cv
::
AutoLock
lock
(
getImplData
().
mutex
);
getImplData
().
useCollection
=
flag
;
}
#endif
...
...
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