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
b0c5f491
Commit
b0c5f491
authored
Jan 13, 2015
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build fixes for GPU samples.
parent
c0d76ef9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
driver_api_multi.cpp
samples/gpu/driver_api_multi.cpp
+4
-4
driver_api_stereo_multi.cpp
samples/gpu/driver_api_stereo_multi.cpp
+1
-2
multi.cpp
samples/gpu/multi.cpp
+1
-1
No files found.
samples/gpu/driver_api_multi.cpp
100755 → 100644
View file @
b0c5f491
...
...
@@ -41,8 +41,8 @@ struct Worker: public ParallelLoopBody
Worker
(
int
num_devices
)
{
count
=
num_devices
;
contexts
=
new
contexts
CUcontext
[
num_devices
];
for
(
int
device_id
=
0
;
i
<
num_devices
;
device_id
++
)
contexts
=
new
CUcontext
[
num_devices
];
for
(
int
device_id
=
0
;
device_id
<
num_devices
;
device_id
++
)
{
CUdevice
device
;
safeCall
(
cuDeviceGet
(
&
device
,
device_id
));
...
...
@@ -90,7 +90,7 @@ struct Worker: public ParallelLoopBody
{
if
((
contexts
!=
NULL
)
&&
count
!=
0
)
{
for
(
int
device_id
=
0
;
i
<
num_devices
;
device_id
++
)
for
(
int
device_id
=
0
;
device_id
<
count
;
device_id
++
)
{
safeCall
(
cuCtxDestroy
(
contexts
[
device_id
]));
}
...
...
@@ -130,7 +130,7 @@ int main()
safeCall
(
cuInit
(
0
));
// Execute calculation
parallel_for_
(
cv
::
Range
(
0
,
num_devices
,
Worker
(
num_devices
));
parallel_for_
(
cv
::
Range
(
0
,
num_devices
)
,
Worker
(
num_devices
));
return
0
;
}
...
...
samples/gpu/driver_api_stereo_multi.cpp
View file @
b0c5f491
...
...
@@ -8,7 +8,6 @@
#endif
#include <iostream>
#include "cvconfig.h"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/gpu/gpu.hpp"
...
...
@@ -169,7 +168,7 @@ int main(int argc, char** argv)
contextOff
();
// Execute calculation in two threads using two GPUs
parallel_for_
(
cv
::
Range
(
0
,
2
,
Worker
());
parallel_for_
(
cv
::
Range
(
0
,
2
)
,
Worker
());
// Release the first GPU resources
contextOn
(
0
);
...
...
samples/gpu/multi.cpp
View file @
b0c5f491
...
...
@@ -72,7 +72,7 @@ int main()
}
// Execute calculation in several threads, 1 GPU per thread
parallel_for_
(
cv
::
Range
(
0
,
num_devices
,
Worker
());
parallel_for_
(
cv
::
Range
(
0
,
num_devices
)
,
Worker
());
return
0
;
}
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