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
6aff916a
Commit
6aff916a
authored
Sep 04, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12398 from alalek:samples_eliminate_cvconfig
parents
4f9db2c0
afb81ba6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
37 deletions
+15
-37
CMakeLists.txt
samples/gpu/CMakeLists.txt
+3
-0
cascadeclassifier_nvidia_api.cpp
samples/gpu/cascadeclassifier_nvidia_api.cpp
+0
-1
multi.cpp
samples/gpu/multi.cpp
+12
-20
opticalflow_nvidia_api.cpp
samples/gpu/opticalflow_nvidia_api.cpp
+0
-1
display.cpp.inc
samples/va_intel/display.cpp.inc
+0
-2
va_intel_interop.cpp
samples/va_intel/va_intel_interop.cpp
+0
-13
No files found.
samples/gpu/CMakeLists.txt
View file @
6aff916a
...
...
@@ -30,6 +30,9 @@ if(NOT BUILD_EXAMPLES OR NOT OCV_DEPENDENCIES_FOUND)
endif
()
project
(
gpu_samples
)
if
(
HAVE_CUDA OR CUDA_FOUND
)
add_definitions
(
-DHAVE_CUDA=1
)
endif
()
if
(
COMMAND ocv_warnings_disable
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wsuggest-override -Winconsistent-missing-override
)
endif
()
...
...
samples/gpu/cascadeclassifier_nvidia_api.cpp
View file @
6aff916a
...
...
@@ -2,7 +2,6 @@
#pragma warning( disable : 4201 4408 4127 4100)
#endif
#include "opencv2/cvconfig.h"
#include <iostream>
#include <iomanip>
#include <cstdio>
...
...
samples/gpu/multi.cpp
View file @
6aff916a
...
...
@@ -7,29 +7,14 @@
#endif
#include <iostream>
#include "opencv2/cvconfig.h"
#include "opencv2/core.hpp"
#include "opencv2/cudaarithm.hpp"
#ifdef HAVE_TBB
# include "tbb/tbb.h"
# include "tbb/task.h"
# undef min
# undef max
#endif
#if !defined(HAVE_CUDA) || !defined(HAVE_TBB)
#if !defined(HAVE_CUDA)
int
main
()
{
#if !defined(HAVE_CUDA)
std
::
cout
<<
"CUDA support is required (CMake key 'WITH_CUDA' must be true).
\n
"
;
#endif
#if !defined(HAVE_TBB)
std
::
cout
<<
"TBB support is required (CMake key 'WITH_TBB' must be true).
\n
"
;
#endif
std
::
cout
<<
"CUDA support is required (OpenCV CMake parameter 'WITH_CUDA' must be true)."
<<
std
::
endl
;
return
0
;
}
...
...
@@ -39,7 +24,14 @@ using namespace std;
using
namespace
cv
;
using
namespace
cv
::
cuda
;
struct
Worker
{
void
operator
()(
int
device_id
)
const
;
};
struct
Worker
:
public
cv
::
ParallelLoopBody
{
void
operator
()(
const
Range
&
r
)
const
CV_OVERRIDE
{
for
(
int
i
=
r
.
start
;
i
<
r
.
end
;
++
i
)
{
this
->
operator
()(
i
);
}
}
void
operator
()(
int
device_id
)
const
;
};
int
main
()
{
...
...
@@ -64,8 +56,8 @@ int main()
}
// Execute calculation in two threads using two GPUs
int
devices
[]
=
{
0
,
1
}
;
tbb
::
parallel_do
(
devices
,
devices
+
2
,
Worker
());
cv
::
Range
devices
(
0
,
2
)
;
cv
::
parallel_for_
(
devices
,
Worker
(),
devices
.
size
());
return
0
;
}
...
...
samples/gpu/opticalflow_nvidia_api.cpp
View file @
6aff916a
...
...
@@ -9,7 +9,6 @@
#include <ctime>
#include <ctype.h>
#include "cvconfig.h"
#include <iostream>
#include <iomanip>
#include "opencv2/core/cuda.hpp"
...
...
samples/va_intel/display.cpp.inc
View file @
6aff916a
...
...
@@ -7,8 +7,6 @@
#include <sys/types.h>
#include <unistd.h>
#include "cvconfig.h"
#include <va/va.h>
# include <va/va_drm.h>
...
...
samples/va_intel/va_intel_interop.cpp
View file @
6aff916a
...
...
@@ -45,7 +45,6 @@
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/core/va_intel.hpp"
#include "cvconfig.h"
#define CHECK_VASTATUS(_status,_func) \
if (_status != VA_STATUS_SUCCESS) \
...
...
@@ -65,15 +64,9 @@ public:
void
usage
()
{
fprintf
(
stderr
,
#if defined(HAVE_VA_INTEL)
"Usage: va_intel_interop [-f] infile outfile1 outfile2
\n\n
"
"Interop ON/OFF version
\n\n
"
"where: -f option indicates interop is off (fallback mode); interop is on by default
\n
"
#elif defined(HAVE_VA)
"Usage: va_intel_interop infile outfile1 outfile2
\n\n
"
"Interop OFF only version
\n\n
"
"where:
\n
"
#endif //HAVE_VA_INTEL / HAVE_VA
" infile is to be existing, contains input image data (bmp, jpg, png, tiff, etc)
\n
"
" outfile1 is to be created, contains original surface data (NV12)
\n
"
" outfile2 is to be created, contains processed surface data (NV12)
\n
"
);
...
...
@@ -84,20 +77,14 @@ public:
int
n
=
0
;
for
(
int
i
=
0
;
i
<
_fnNumFiles
;
++
i
)
m_files
[
i
]
=
0
;
#if defined(HAVE_VA_INTEL)
m_interop
=
true
;
#elif defined(HAVE_VA)
m_interop
=
false
;
#endif //HAVE_VA_INTEL / HAVE_VA
for
(
int
i
=
1
;
i
<
m_argc
;
++
i
)
{
const
char
*
arg
=
m_argv
[
i
];
if
(
arg
[
0
]
==
'-'
)
// option
{
#if defined(HAVE_VA_INTEL)
if
(
!
strcmp
(
arg
,
"-f"
))
m_interop
=
false
;
#endif //HAVE_VA_INTEL
}
else
// parameter
{
...
...
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