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
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
27 deletions
+30
-27
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
+6
-4
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
+2
-3
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
50429d8a
...
@@ -99,8 +99,8 @@ namespace cv
...
@@ -99,8 +99,8 @@ namespace cv
string
name
()
const
{
return
name_
;
}
string
name
()
const
{
return
name_
;
}
int
major
()
const
{
return
major
_
;
}
int
major
Version
()
const
{
return
majorVersion
_
;
}
int
minor
()
const
{
return
minor
_
;
}
int
minor
Version
()
const
{
return
minorVersion
_
;
}
int
multiProcessorCount
()
const
{
return
multi_processor_count_
;
}
int
multiProcessorCount
()
const
{
return
multi_processor_count_
;
}
...
@@ -118,7 +118,8 @@ namespace cv
...
@@ -118,7 +118,8 @@ namespace cv
string
name_
;
string
name_
;
int
multi_processor_count_
;
int
multi_processor_count_
;
int
major_
,
minor_
;
int
majorVersion_
;
int
minorVersion_
;
};
};
//////////////////////////////// Error handling ////////////////////////
//////////////////////////////// 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)
...
@@ -1258,7 +1258,7 @@ Size cv::gpu::ConvolveBuf::estimateBlockSize(Size result_size, Size templ_size)
Size
bsize_min
(
1024
,
1024
);
Size
bsize_min
(
1024
,
1024
);
// Check whether we use Fermi generation or newer GPU
// Check whether we use Fermi generation or newer GPU
if
(
DeviceInfo
().
major
()
>=
2
)
if
(
DeviceInfo
().
major
Version
()
>=
2
)
{
{
bsize_min
.
width
=
2048
;
bsize_min
.
width
=
2048
;
bsize_min
.
height
=
2048
;
bsize_min
.
height
=
2048
;
...
@@ -1295,7 +1295,6 @@ void cv::gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result,
...
@@ -1295,7 +1295,6 @@ void cv::gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result,
Size
&
block_size
=
buf
.
block_size
;
Size
&
block_size
=
buf
.
block_size
;
Size
&
dft_size
=
buf
.
dft_size
;
Size
&
dft_size
=
buf
.
dft_size
;
int
&
spect_len
=
buf
.
spect_len
;
GpuMat
&
image_block
=
buf
.
image_block
;
GpuMat
&
image_block
=
buf
.
image_block
;
GpuMat
&
templ_block
=
buf
.
templ_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
...
@@ -175,23 +175,20 @@ size_t cv::gpu::DeviceInfo::totalMemory() const
bool
cv
::
gpu
::
DeviceInfo
::
has
(
cv
::
gpu
::
GpuFeature
feature
)
const
bool
cv
::
gpu
::
DeviceInfo
::
has
(
cv
::
gpu
::
GpuFeature
feature
)
const
{
{
if
(
feature
==
NATIVE_DOUBLE
)
int
version
=
majorVersion
()
*
10
+
minorVersion
();
return
major
()
>
1
||
(
major
()
==
1
&&
minor
()
>=
3
);
return
version
>=
feature
;
if
(
feature
==
ATOMICS
)
return
major
()
>
1
||
(
major
()
==
1
&&
minor
()
>=
1
);
return
false
;
}
}
bool
cv
::
gpu
::
DeviceInfo
::
isCompatible
()
const
bool
cv
::
gpu
::
DeviceInfo
::
isCompatible
()
const
{
{
// Check PTX compatibility
// Check PTX compatibility
if
(
TargetArchs
::
hasEqualOrLessPtx
(
major
(),
minor
()))
if
(
TargetArchs
::
hasEqualOrLessPtx
(
major
Version
(),
minorVersion
()))
return
true
;
return
true
;
// Check BIN compatibility
// Check BIN compatibility
for
(
int
i
=
minor
();
i
>=
0
;
--
i
)
for
(
int
i
=
minor
Version
();
i
>=
0
;
--
i
)
if
(
TargetArchs
::
hasBin
(
major
(),
i
))
if
(
TargetArchs
::
hasBin
(
major
Version
(),
i
))
return
true
;
return
true
;
return
false
;
return
false
;
...
@@ -204,8 +201,8 @@ void cv::gpu::DeviceInfo::query()
...
@@ -204,8 +201,8 @@ void cv::gpu::DeviceInfo::query()
cudaSafeCall
(
cudaGetDeviceProperties
(
&
prop
,
device_id_
));
cudaSafeCall
(
cudaGetDeviceProperties
(
&
prop
,
device_id_
));
name_
=
prop
.
name
;
name_
=
prop
.
name
;
multi_processor_count_
=
prop
.
multiProcessorCount
;
multi_processor_count_
=
prop
.
multiProcessorCount
;
major_
=
prop
.
major
;
major
Version
_
=
prop
.
major
;
minor_
=
prop
.
minor
;
minor
Version
_
=
prop
.
minor
;
}
}
...
...
modules/gpu/src/stereobm.cpp
View file @
50429d8a
...
@@ -88,7 +88,7 @@ bool cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable()
...
@@ -88,7 +88,7 @@ bool cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable()
DeviceInfo
device_info
;
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
true
;
return
false
;
return
false
;
...
...
samples/gpu/multi.cpp
View file @
50429d8a
...
@@ -59,9 +59,12 @@ int main()
...
@@ -59,9 +59,12 @@ int main()
for
(
int
i
=
0
;
i
<
num_devices
;
++
i
)
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
;
return
-
1
;
}
}
}
}
...
@@ -131,4 +134,4 @@ void destroyContexts()
...
@@ -131,4 +134,4 @@ void destroyContexts()
safeCall
(
cuCtxDestroy
(
contexts
[
1
]));
safeCall
(
cuCtxDestroy
(
contexts
[
1
]));
}
}
#endif
#endif
\ No newline at end of file
samples/gpu/stereo_multi.cpp
View file @
50429d8a
...
@@ -84,9 +84,12 @@ int main(int argc, char** argv)
...
@@ -84,9 +84,12 @@ int main(int argc, char** argv)
for
(
int
i
=
0
;
i
<
num_devices
;
++
i
)
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
;
return
-
1
;
}
}
}
}
...
...
tests/gpu/src/meanshift.cpp
View file @
50429d8a
...
@@ -56,7 +56,8 @@ struct CV_GpuMeanShiftTest : public CvTest
...
@@ -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
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/cones.png"
);
cv
::
Mat
img_template
;
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"
);
img_template
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/con_result.png"
);
else
else
img_template
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/con_result_CC1X.png"
);
img_template
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/con_result_CC1X.png"
);
...
@@ -199,7 +200,8 @@ struct CV_GpuMeanShiftProcTest : public CvTest
...
@@ -199,7 +200,8 @@ struct CV_GpuMeanShiftProcTest : public CvTest
cv
::
Mat
spmap_template
;
cv
::
Mat
spmap_template
;
cv
::
FileStorage
fs
;
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
);
fs
.
open
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/spmap.yaml"
,
cv
::
FileStorage
::
READ
);
else
else
fs
.
open
(
std
::
string
(
ts
->
get_data_path
())
+
"meanshift/spmap_CC1X.yaml"
,
cv
::
FileStorage
::
READ
);
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 {
...
@@ -69,7 +69,7 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
{
{
stringstream
path
;
stringstream
path
;
path
<<
ts
->
get_data_path
()
<<
"meanshift/cones_segmented_sp10_sr10_minsize"
<<
minsize
;
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"
;
path
<<
".png"
;
else
else
path
<<
"_CC1X.png"
;
path
<<
"_CC1X.png"
;
...
@@ -103,4 +103,4 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
...
@@ -103,4 +103,4 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
ts
->
set_failed_test_info
(
CvTS
::
OK
);
ts
->
set_failed_test_info
(
CvTS
::
OK
);
}
}
}
ms_segm_test
;
}
ms_segm_test
;
\ No newline at 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