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
50429d8a
Commit
50429d8a
authored
Feb 03, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some warnings and errors under g++
parent
97b0335e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
23 deletions
+28
-23
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+4
-3
imgproc_gpu.cpp
modules/gpu/src/imgproc_gpu.cpp
+1
-2
initialization.cpp
modules/gpu/src/initialization.cpp
+7
-10
stereobm.cpp
modules/gpu/src/stereobm.cpp
+1
-1
multi.cpp
samples/gpu/multi.cpp
+5
-2
stereo_multi.cpp
samples/gpu/stereo_multi.cpp
+5
-2
meanshift.cpp
tests/gpu/src/meanshift.cpp
+4
-2
mssegmentation.cpp
tests/gpu/src/mssegmentation.cpp
+1
-1
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
50429d8a
...
...
@@ -99,8 +99,8 @@ namespace cv
string
name
()
const
{
return
name_
;
}
int
major
()
const
{
return
major
_
;
}
int
minor
()
const
{
return
minor
_
;
}
int
major
Version
()
const
{
return
majorVersion
_
;
}
int
minor
Version
()
const
{
return
minorVersion
_
;
}
int
multiProcessorCount
()
const
{
return
multi_processor_count_
;
}
...
...
@@ -118,7 +118,8 @@ namespace cv
string
name_
;
int
multi_processor_count_
;
int
major_
,
minor_
;
int
majorVersion_
;
int
minorVersion_
;
};
//////////////////////////////// Error handling ////////////////////////
...
...
modules/gpu/src/imgproc_gpu.cpp
View file @
50429d8a
...
...
@@ -1258,7 +1258,7 @@ Size cv::gpu::ConvolveBuf::estimateBlockSize(Size result_size, Size templ_size)
Size
bsize_min
(
1024
,
1024
);
// Check whether we use Fermi generation or newer GPU
if
(
DeviceInfo
().
major
()
>=
2
)
if
(
DeviceInfo
().
major
Version
()
>=
2
)
{
bsize_min
.
width
=
2048
;
bsize_min
.
height
=
2048
;
...
...
@@ -1295,7 +1295,6 @@ void cv::gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result,
Size
&
block_size
=
buf
.
block_size
;
Size
&
dft_size
=
buf
.
dft_size
;
int
&
spect_len
=
buf
.
spect_len
;
GpuMat
&
image_block
=
buf
.
image_block
;
GpuMat
&
templ_block
=
buf
.
templ_block
;
...
...
modules/gpu/src/initialization.cpp
View file @
50429d8a
...
...
@@ -175,23 +175,20 @@ size_t cv::gpu::DeviceInfo::totalMemory() const
bool
cv
::
gpu
::
DeviceInfo
::
has
(
cv
::
gpu
::
GpuFeature
feature
)
const
{
if
(
feature
==
NATIVE_DOUBLE
)
return
major
()
>
1
||
(
major
()
==
1
&&
minor
()
>=
3
);
if
(
feature
==
ATOMICS
)
return
major
()
>
1
||
(
major
()
==
1
&&
minor
()
>=
1
);
return
false
;
int
version
=
majorVersion
()
*
10
+
minorVersion
();
return
version
>=
feature
;
}
bool
cv
::
gpu
::
DeviceInfo
::
isCompatible
()
const
{
// Check PTX compatibility
if
(
TargetArchs
::
hasEqualOrLessPtx
(
major
(),
minor
()))
if
(
TargetArchs
::
hasEqualOrLessPtx
(
major
Version
(),
minorVersion
()))
return
true
;
// Check BIN compatibility
for
(
int
i
=
minor
();
i
>=
0
;
--
i
)
if
(
TargetArchs
::
hasBin
(
major
(),
i
))
for
(
int
i
=
minor
Version
();
i
>=
0
;
--
i
)
if
(
TargetArchs
::
hasBin
(
major
Version
(),
i
))
return
true
;
return
false
;
...
...
@@ -204,8 +201,8 @@ void cv::gpu::DeviceInfo::query()
cudaSafeCall
(
cudaGetDeviceProperties
(
&
prop
,
device_id_
));
name_
=
prop
.
name
;
multi_processor_count_
=
prop
.
multiProcessorCount
;
major_
=
prop
.
major
;
minor_
=
prop
.
minor
;
major
Version
_
=
prop
.
major
;
minor
Version
_
=
prop
.
minor
;
}
...
...
modules/gpu/src/stereobm.cpp
View file @
50429d8a
...
...
@@ -88,7 +88,7 @@ bool cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable()
DeviceInfo
device_info
;
if
(
device_info
.
major
()
>
1
||
device_info
.
multiProcessorCount
()
>
16
)
if
(
device_info
.
major
Version
()
>
1
||
device_info
.
multiProcessorCount
()
>
16
)
return
true
;
return
false
;
...
...
samples/gpu/multi.cpp
View file @
50429d8a
...
...
@@ -59,9 +59,12 @@ int main()
for
(
int
i
=
0
;
i
<
num_devices
;
++
i
)
{
if
(
!
DeviceInfo
(
i
).
isCompatible
())
DeviceInfo
dev_info
(
i
);
if
(
!
dev_info
.
isCompatible
())
{
cout
<<
"GPU module isn't built for GPU #"
<<
i
<<
" ("
<<
DeviceInfo
(
i
).
name
()
<<
")"
;
cout
<<
"GPU module isn't built for GPU #"
<<
i
<<
" ("
<<
dev_info
.
name
()
<<
", CC "
<<
dev_info
.
majorVersion
()
<<
dev_info
.
minorVersion
()
<<
"
\n
"
;
return
-
1
;
}
}
...
...
samples/gpu/stereo_multi.cpp
View file @
50429d8a
...
...
@@ -84,9 +84,12 @@ int main(int argc, char** argv)
for
(
int
i
=
0
;
i
<
num_devices
;
++
i
)
{
if
(
!
DeviceInfo
(
i
).
isCompatible
())
DeviceInfo
dev_info
(
i
);
if
(
!
dev_info
.
isCompatible
())
{
cout
<<
"GPU module isn't built for GPU #"
<<
i
<<
" ("
<<
DeviceInfo
(
i
).
name
()
<<
")"
;
cout
<<
"GPU module isn't built for GPU #"
<<
i
<<
" ("
<<
dev_info
.
name
()
<<
", CC "
<<
dev_info
.
majorVersion
()
<<
dev_info
.
minorVersion
()
<<
"
\n
"
;
return
-
1
;
}
}
...
...
tests/gpu/src/meanshift.cpp
View file @
50429d8a
...
...
@@ -56,7 +56,8 @@ struct CV_GpuMeanShiftTest : public CvTest
cv
::
Mat
img
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/cones.png"
);
cv
::
Mat
img_template
;
if
(
cv
::
gpu
::
TargetArchs
::
builtWith
(
cv
::
gpu
::
COMPUTE_20
)
&&
cv
::
gpu
::
DeviceInfo
().
major
()
>=
2
)
if
(
cv
::
gpu
::
TargetArchs
::
builtWith
(
cv
::
gpu
::
COMPUTE_20
)
&&
cv
::
gpu
::
DeviceInfo
().
has
(
cv
::
gpu
::
COMPUTE_20
))
img_template
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/con_result.png"
);
else
img_template
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/con_result_CC1X.png"
);
...
...
@@ -199,7 +200,8 @@ struct CV_GpuMeanShiftProcTest : public CvTest
cv
::
Mat
spmap_template
;
cv
::
FileStorage
fs
;
if
(
cv
::
gpu
::
TargetArchs
::
builtWith
(
cv
::
gpu
::
COMPUTE_20
)
&&
cv
::
gpu
::
DeviceInfo
().
major
()
>=
2
)
if
(
cv
::
gpu
::
TargetArchs
::
builtWith
(
cv
::
gpu
::
COMPUTE_20
)
&&
cv
::
gpu
::
DeviceInfo
().
has
(
cv
::
gpu
::
COMPUTE_20
))
fs
.
open
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/spmap.yaml"
,
cv
::
FileStorage
::
READ
);
else
fs
.
open
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/spmap_CC1X.yaml"
,
cv
::
FileStorage
::
READ
);
...
...
tests/gpu/src/mssegmentation.cpp
View file @
50429d8a
...
...
@@ -69,7 +69,7 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
{
stringstream
path
;
path
<<
ts
->
get_data_path
()
<<
"meanshift/cones_segmented_sp10_sr10_minsize"
<<
minsize
;
if
(
TargetArchs
::
builtWith
(
COMPUTE_20
)
&&
DeviceInfo
().
major
()
>=
2
)
if
(
TargetArchs
::
builtWith
(
COMPUTE_20
)
&&
DeviceInfo
().
has
(
COMPUTE_20
)
)
path
<<
".png"
;
else
path
<<
"_CC1X.png"
;
...
...
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