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
f8484e32
Commit
f8484e32
authored
Feb 26, 2015
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fucntion to control tegra optimizations in run-time
parent
f73c6e61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
private.hpp
modules/core/include/opencv2/core/private.hpp
+9
-0
precomp.hpp
modules/core/src/precomp.hpp
+6
-0
system.cpp
modules/core/src/system.cpp
+30
-0
No files found.
modules/core/include/opencv2/core/private.hpp
View file @
f8484e32
...
...
@@ -269,6 +269,15 @@ typedef enum CvStatus
}
CvStatus
;
#ifdef HAVE_TEGRA_OPTIMIZATION
namespace
cv
{
namespace
tegra
{
CV_EXPORTS
bool
useTegra
();
CV_EXPORTS
void
setUseTegra
(
bool
flag
);
}
#endif
//! @endcond
#endif // __OPENCV_CORE_PRIVATE_HPP__
modules/core/src/precomp.hpp
View file @
f8484e32
...
...
@@ -236,6 +236,9 @@ struct CoreTLSData
{
CoreTLSData
()
:
device
(
0
),
useOpenCL
(
-
1
),
useIPP
(
-
1
),
useCollection
(
false
)
{
#ifdef HAVE_TEGRA_OPTIMIZATION
useTegra
=
-
1
;
#endif
#ifdef CV_COLLECT_IMPL_DATA
implFlags
=
0
;
#endif
...
...
@@ -246,6 +249,9 @@ struct CoreTLSData
ocl
::
Queue
oclQueue
;
int
useOpenCL
;
// 1 - use, 0 - do not use, -1 - auto/not initialized
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
...
...
modules/core/src/system.cpp
View file @
f8484e32
...
...
@@ -1257,6 +1257,36 @@ void setUseIPP(bool flag)
}
// namespace ipp
#ifdef HAVE_TEGRA_OPTIMIZATION
namespace
tegra
{
bool
useTegra
()
{
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
if
(
data
->
useTegra
<
0
)
{
const
char
*
pTegraEnv
=
getenv
(
"OPENCV_TEGRA"
);
if
(
pTegraEnv
&&
(
cv
::
String
(
pTegraEnv
)
==
"disabled"
))
data
->
useTegra
=
false
;
else
data
->
useTegra
=
true
;
}
return
(
data
->
useTegra
>
0
);
}
void
setUseTegra
(
bool
flag
)
{
CoreTLSData
*
data
=
getCoreTlsData
().
get
();
data
->
useTegra
=
flag
;
}
}
// namespace tegra
#endif
}
// namespace cv
/* 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