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
575fd1fe
Commit
575fd1fe
authored
Jan 28, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reafactoring: replaced query device props functions with the DeviceInfo class
parent
e6d17406
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
123 additions
and
119 deletions
+123
-119
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+27
-7
brute_force_matcher.cpp
modules/gpu/src/brute_force_matcher.cpp
+1
-1
imgproc_gpu.cpp
modules/gpu/src/imgproc_gpu.cpp
+1
-4
initialization.cpp
modules/gpu/src/initialization.cpp
+63
-64
matrix_reductions.cpp
modules/gpu/src/matrix_reductions.cpp
+10
-10
split_merge.cpp
modules/gpu/src/split_merge.cpp
+2
-2
stereobm.cpp
modules/gpu/src/stereobm.cpp
+2
-6
surf.cpp
modules/gpu/src/surf.cpp
+1
-1
arithm.cpp
tests/gpu/src/arithm.cpp
+3
-3
bitwise_oper.cpp
tests/gpu/src/bitwise_oper.cpp
+1
-1
match_template.cpp
tests/gpu/src/match_template.cpp
+2
-2
meanshift.cpp
tests/gpu/src/meanshift.cpp
+3
-9
mssegmentation.cpp
tests/gpu/src/mssegmentation.cpp
+2
-4
split_merge.cpp
tests/gpu/src/split_merge.cpp
+5
-5
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
575fd1fe
...
@@ -60,7 +60,7 @@ namespace cv
...
@@ -60,7 +60,7 @@ namespace cv
CV_EXPORTS
int
getCudaEnabledDeviceCount
();
CV_EXPORTS
int
getCudaEnabledDeviceCount
();
//! Functions below throw cv::Expception if the library is compiled without Cuda.
//! Functions below throw cv::Expception if the library is compiled without Cuda.
CV_EXPORTS
string
getDeviceName
(
int
device
);
CV_EXPORTS
void
setDevice
(
int
device
);
CV_EXPORTS
void
setDevice
(
int
device
);
CV_EXPORTS
int
getDevice
();
CV_EXPORTS
int
getDevice
();
...
@@ -85,15 +85,35 @@ namespace cv
...
@@ -85,15 +85,35 @@ namespace cv
TargetArchs
();
TargetArchs
();
};
};
CV_EXPORTS
void
getComputeCapability
(
int
device
,
int
&
major
,
int
&
minor
);
class
CV_EXPORTS
DeviceInfo
CV_EXPORTS
int
getNumberOfSMs
(
int
device
);
{
public
:
DeviceInfo
()
:
device_id_
(
getDevice
())
{
query
();
}
DeviceInfo
(
int
device_id
)
:
device_id_
(
device_id
)
{
query
();
}
string
name
()
const
{
return
name_
;
}
int
major
()
const
{
return
major_
;
}
int
minor
()
const
{
return
minor_
;
}
CV_EXPORTS
void
getGpuMemInfo
(
size_t
&
free
,
size_t
&
total
);
int
multiProcessorCount
()
const
{
return
multi_processor_count_
;
}
CV_EXPORTS
bool
hasNativeDoubleSupport
(
int
device
)
;
size_t
freeMemory
()
const
;
CV_EXPORTS
bool
hasAtomicsSupport
(
int
device
)
;
size_t
totalMemory
()
const
;
CV_EXPORTS
bool
isCompatibleWith
(
int
device
);
bool
has
(
GpuFeature
feature
)
const
;
bool
isCompatible
()
const
;
private
:
void
query
();
void
queryMemory
(
size_t
&
free_memory
,
size_t
&
total_memory
)
const
;
int
device_id_
;
string
name_
;
int
multi_processor_count_
;
int
major_
,
minor_
;
};
//////////////////////////////// Error handling ////////////////////////
//////////////////////////////// Error handling ////////////////////////
...
...
modules/gpu/src/brute_force_matcher.cpp
View file @
575fd1fe
...
@@ -531,7 +531,7 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatch(const GpuMat& queryDescs,
...
@@ -531,7 +531,7 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatch(const GpuMat& queryDescs,
}
}
};
};
CV_Assert
(
hasAtomicsSupport
(
getDevice
()
));
CV_Assert
(
DeviceInfo
().
has
(
ATOMICS
));
const
int
nQuery
=
queryDescs
.
rows
;
const
int
nQuery
=
queryDescs
.
rows
;
const
int
nTrain
=
trainDescs
.
rows
;
const
int
nTrain
=
trainDescs
.
rows
;
...
...
modules/gpu/src/imgproc_gpu.cpp
View file @
575fd1fe
...
@@ -1246,14 +1246,11 @@ void cv::gpu::ConvolveBuf::create(Size image_size, Size templ_size)
...
@@ -1246,14 +1246,11 @@ void cv::gpu::ConvolveBuf::create(Size image_size, Size templ_size)
Size
cv
::
gpu
::
ConvolveBuf
::
estimateBlockSize
(
Size
result_size
,
Size
templ_size
)
Size
cv
::
gpu
::
ConvolveBuf
::
estimateBlockSize
(
Size
result_size
,
Size
templ_size
)
{
{
int
major
,
minor
;
getComputeCapability
(
getDevice
(),
major
,
minor
);
int
scale
=
40
;
int
scale
=
40
;
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
(
major
>=
2
)
if
(
DeviceInfo
().
major
()
>=
2
)
{
{
bsize_min
.
width
=
2048
;
bsize_min
.
width
=
2048
;
bsize_min
.
height
=
2048
;
bsize_min
.
height
=
2048
;
...
...
modules/gpu/src/initialization.cpp
View file @
575fd1fe
...
@@ -49,18 +49,18 @@ using namespace cv::gpu;
...
@@ -49,18 +49,18 @@ using namespace cv::gpu;
namespace
namespace
{
{
template
<
typename
Comparer
>
template
<
typename
Comparer
>
bool
compare
(
const
std
::
string
&
str
,
int
x
,
Comparer
cmp
)
bool
compare
ToSet
(
const
std
::
string
&
set_as_str
,
int
value
,
Comparer
cmp
)
{
{
if
(
str
.
find_first_not_of
(
" "
)
==
string
::
npos
)
if
(
s
et_as_s
tr
.
find_first_not_of
(
" "
)
==
string
::
npos
)
return
false
;
return
false
;
std
::
stringstream
stream
(
str
);
std
::
stringstream
stream
(
s
et_as_s
tr
);
int
val
;
int
cur_value
;
while
(
!
stream
.
eof
())
while
(
!
stream
.
eof
())
{
{
stream
>>
val
;
stream
>>
cur_value
;
if
(
cmp
(
val
,
x
))
if
(
cmp
(
cur_value
,
value
))
return
true
;
return
true
;
}
}
...
@@ -87,19 +87,19 @@ CV_EXPORTS bool cv::gpu::TargetArchs::has(int major, int minor)
...
@@ -87,19 +87,19 @@ CV_EXPORTS bool cv::gpu::TargetArchs::has(int major, int minor)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasPtx
(
int
major
,
int
minor
)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasPtx
(
int
major
,
int
minor
)
{
{
return
::
compare
(
CUDA_ARCH_PTX
,
major
*
10
+
minor
,
std
::
equal_to
<
int
>
());
return
::
compare
ToSet
(
CUDA_ARCH_PTX
,
major
*
10
+
minor
,
std
::
equal_to
<
int
>
());
}
}
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasBin
(
int
major
,
int
minor
)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasBin
(
int
major
,
int
minor
)
{
{
return
::
compare
(
CUDA_ARCH_BIN
,
major
*
10
+
minor
,
std
::
equal_to
<
int
>
());
return
::
compare
ToSet
(
CUDA_ARCH_BIN
,
major
*
10
+
minor
,
std
::
equal_to
<
int
>
());
}
}
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasEqualOrLessPtx
(
int
major
,
int
minor
)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasEqualOrLessPtx
(
int
major
,
int
minor
)
{
{
return
::
compare
(
CUDA_ARCH_PTX
,
major
*
10
+
minor
,
return
::
compare
ToSet
(
CUDA_ARCH_PTX
,
major
*
10
+
minor
,
std
::
less_equal
<
int
>
());
std
::
less_equal
<
int
>
());
}
}
...
@@ -113,14 +113,14 @@ CV_EXPORTS bool cv::gpu::TargetArchs::hasEqualOrGreater(int major, int minor)
...
@@ -113,14 +113,14 @@ CV_EXPORTS bool cv::gpu::TargetArchs::hasEqualOrGreater(int major, int minor)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreaterPtx
(
int
major
,
int
minor
)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreaterPtx
(
int
major
,
int
minor
)
{
{
return
::
compare
(
CUDA_ARCH_PTX
,
major
*
10
+
minor
,
return
::
compare
ToSet
(
CUDA_ARCH_PTX
,
major
*
10
+
minor
,
std
::
greater_equal
<
int
>
());
std
::
greater_equal
<
int
>
());
}
}
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreaterBin
(
int
major
,
int
minor
)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreaterBin
(
int
major
,
int
minor
)
{
{
return
::
compare
(
CUDA_ARCH_BIN
,
major
*
10
+
minor
,
return
::
compare
ToSet
(
CUDA_ARCH_BIN
,
major
*
10
+
minor
,
std
::
greater_equal
<
int
>
());
std
::
greater_equal
<
int
>
());
}
}
...
@@ -128,16 +128,20 @@ CV_EXPORTS bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
...
@@ -128,16 +128,20 @@ CV_EXPORTS bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
#if !defined (HAVE_CUDA)
#if !defined (HAVE_CUDA)
CV_EXPORTS
int
cv
::
gpu
::
getCudaEnabledDeviceCount
()
{
return
0
;
}
CV_EXPORTS
int
cv
::
gpu
::
getCudaEnabledDeviceCount
()
{
return
0
;
}
CV_EXPORTS
string
cv
::
gpu
::
getDeviceName
(
int
/*device*/
)
{
throw_nogpu
();
return
0
;
}
CV_EXPORTS
void
cv
::
gpu
::
setDevice
(
int
)
{
throw_nogpu
();
}
CV_EXPORTS
void
cv
::
gpu
::
setDevice
(
int
/*device*/
)
{
throw_nogpu
();
}
CV_EXPORTS
int
cv
::
gpu
::
getDevice
()
{
throw_nogpu
();
return
0
;
}
CV_EXPORTS
int
cv
::
gpu
::
getDevice
()
{
throw_nogpu
();
return
0
;
}
CV_EXPORTS
void
cv
::
gpu
::
getComputeCapability
(
int
/*device*/
,
int
&
/*major*/
,
int
&
/*minor*/
)
{
throw_nogpu
();
}
cv
::
gpu
::
DeviceInfo
::
DeviceInfo
()
{
throw_nogpu
();
}
CV_EXPORTS
int
cv
::
gpu
::
getNumberOfSMs
(
int
/*device*/
)
{
throw_nogpu
();
return
0
;
}
cv
::
gpu
::
DeviceInfo
::
DeviceInfo
(
int
)
{
throw_nogpu
();
}
CV_EXPORTS
void
cv
::
gpu
::
getGpuMemInfo
(
size_t
&
/*free*/
,
size_t
&
/*total*/
)
{
throw_nogpu
();
}
string
cv
::
gpu
::
DeviceInfo
::
name
()
const
{
throw_nogpu
();
return
""
;
}
CV_EXPORTS
bool
cv
::
gpu
::
hasNativeDoubleSupport
(
int
/*device*/
)
{
throw_nogpu
();
return
false
;
}
int
cv
::
gpu
::
DeviceInfo
::
major
()
const
{
throw_nogpu
();
return
0
;
}
CV_EXPORTS
bool
cv
::
gpu
::
hasAtomicsSupport
(
int
/*device*/
)
{
throw_nogpu
();
return
false
;
}
int
cv
::
gpu
::
DeviceInfo
::
minor
()
const
{
throw_nogpu
();
return
0
;
}
CV_EXPORTS
bool
cv
::
gpu
::
isCompatibleWith
(
int
device
)
{
throw_nogpu
();
return
false
;
}
int
cv
::
gpu
::
DeviceInfo
::
multiProcessorCount
()
const
{
throw_nogpu
();
return
0
;
}
size_t
cv
::
gpu
::
DeviceInfo
::
freeMemory
()
const
{
throw_nogpu
();
return
0
;
}
size_t
cv
::
gpu
::
DeviceInfo
::
totalMemory
()
const
{
throw_nogpu
();
return
0
;
}
bool
cv
::
gpu
::
DeviceInfo
::
has
(
cv
::
gpu
::
GpuFeature
)
const
{
throw_nogpu
();
return
false
;
}
bool
cv
::
gpu
::
DeviceInfo
::
isCompatible
()
const
{
throw_nogpu
();
return
false
;
}
void
cv
::
gpu
::
DeviceInfo
::
query
()
const
{
throw_nogpu
();
}
void
cv
::
gpu
::
DeviceInfo
::
queryMemory
(
size_t
,
size_t
)
const
{
throw_nogpu
();
}
#else
/* !defined (HAVE_CUDA) */
#else
/* !defined (HAVE_CUDA) */
...
@@ -149,14 +153,6 @@ CV_EXPORTS int cv::gpu::getCudaEnabledDeviceCount()
...
@@ -149,14 +153,6 @@ CV_EXPORTS int cv::gpu::getCudaEnabledDeviceCount()
}
}
CV_EXPORTS
string
cv
::
gpu
::
getDeviceName
(
int
device
)
{
cudaDeviceProp
prop
;
cudaSafeCall
(
cudaGetDeviceProperties
(
&
prop
,
device
)
);
return
prop
.
name
;
}
CV_EXPORTS
void
cv
::
gpu
::
setDevice
(
int
device
)
CV_EXPORTS
void
cv
::
gpu
::
setDevice
(
int
device
)
{
{
cudaSafeCall
(
cudaSetDevice
(
device
)
);
cudaSafeCall
(
cudaSetDevice
(
device
)
);
...
@@ -171,65 +167,68 @@ CV_EXPORTS int cv::gpu::getDevice()
...
@@ -171,65 +167,68 @@ CV_EXPORTS int cv::gpu::getDevice()
}
}
CV_EXPORTS
void
cv
::
gpu
::
getComputeCapability
(
int
device
,
int
&
major
,
int
&
minor
)
size_t
cv
::
gpu
::
DeviceInfo
::
freeMemory
()
const
{
{
cudaDeviceProp
prop
;
size_t
free_memory
,
total_memory
;
cudaSafeCall
(
cudaGetDeviceProperties
(
&
prop
,
device
)
);
queryMemory
(
free_memory
,
total_memory
);
return
free_memory
;
major
=
prop
.
major
;
minor
=
prop
.
minor
;
}
}
CV_EXPORTS
int
cv
::
gpu
::
getNumberOfSMs
(
int
device
)
size_t
cv
::
gpu
::
DeviceInfo
::
totalMemory
()
const
{
{
cudaDeviceProp
prop
;
size_t
free_memory
,
total_memory
;
cudaSafeCall
(
cudaGetDeviceProperties
(
&
prop
,
device
)
);
queryMemory
(
free_memory
,
total_memory
);
return
prop
.
multiProcessorCount
;
return
total_memory
;
}
}
CV_EXPORTS
void
cv
::
gpu
::
getGpuMemInfo
(
size_t
&
free
,
size_t
&
total
)
bool
cv
::
gpu
::
DeviceInfo
::
has
(
cv
::
gpu
::
GpuFeature
feature
)
const
{
{
cudaSafeCall
(
cudaMemGetInfo
(
&
free
,
&
total
)
);
if
(
feature
==
NATIVE_DOUBLE
)
return
major
()
>
1
||
(
major
()
==
1
&&
minor
()
>=
3
);
if
(
feature
==
ATOMICS
)
return
major
()
>
1
||
(
major
()
==
1
&&
minor
()
>=
1
);
return
false
;
}
}
CV_EXPORTS
bool
cv
::
gpu
::
hasNativeDoubleSupport
(
int
device
)
bool
cv
::
gpu
::
DeviceInfo
::
isCompatible
()
const
{
{
int
major
,
minor
;
// Check PTX compatibility
getComputeCapability
(
device
,
major
,
minor
);
if
(
TargetArchs
::
hasEqualOrLessPtx
(
major
(),
minor
()))
return
major
>
1
||
(
major
==
1
&&
minor
>=
3
);
return
true
;
}
// Check BIN compatibility
for
(
int
i
=
minor
();
i
>=
0
;
--
i
)
if
(
TargetArchs
::
hasBin
(
major
(),
i
))
return
true
;
CV_EXPORTS
bool
cv
::
gpu
::
hasAtomicsSupport
(
int
device
)
return
false
;
{
int
major
,
minor
;
getComputeCapability
(
device
,
major
,
minor
);
return
major
>
1
||
(
major
==
1
&&
minor
>=
1
);
}
}
CV_EXPORTS
bool
cv
::
gpu
::
isCompatibleWith
(
int
device
)
void
cv
::
gpu
::
DeviceInfo
::
query
(
)
{
{
// According to the CUDA C Programming Guide Version 3.2: "PTX code
cudaDeviceProp
prop
;
// produced for some specific compute capability can always be compiled to
cudaSafeCall
(
cudaGetDeviceProperties
(
&
prop
,
device_id_
));
// binary code of greater or equal compute capability".
name_
=
prop
.
name
;
multi_processor_count_
=
prop
.
multiProcessorCount
;
major_
=
prop
.
major
;
minor_
=
prop
.
minor
;
}
int
major
,
minor
;
getComputeCapability
(
device
,
major
,
minor
);
// Check PTX compatibility
void
cv
::
gpu
::
DeviceInfo
::
queryMemory
(
size_t
&
free_memory
,
size_t
&
total_memory
)
const
if
(
TargetArchs
::
hasEqualOrLessPtx
(
major
,
minor
))
{
return
true
;
int
prev_device_id
=
getDevice
();
if
(
prev_device_id
!=
device_id_
)
setDevice
(
device_id_
);
// Check CUBIN compatibility
cudaSafeCall
(
cudaMemGetInfo
(
&
free_memory
,
&
total_memory
));
for
(
int
i
=
minor
;
i
>=
0
;
--
i
)
if
(
TargetArchs
::
hasBin
(
major
,
i
))
return
true
;
return
false
;
if
(
prev_device_id
!=
device_id_
)
setDevice
(
prev_device_id
);
}
}
#endif
#endif
...
...
modules/gpu/src/matrix_reductions.cpp
View file @
575fd1fe
...
@@ -170,7 +170,7 @@ Scalar cv::gpu::sum(const GpuMat& src, GpuMat& buf)
...
@@ -170,7 +170,7 @@ Scalar cv::gpu::sum(const GpuMat& src, GpuMat& buf)
ensureSizeIsEnough
(
buf_size
,
CV_8U
,
buf
);
ensureSizeIsEnough
(
buf_size
,
CV_8U
,
buf
);
Caller
*
callers
=
multipass_callers
;
Caller
*
callers
=
multipass_callers
;
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
hasAtomicsSupport
(
getDevice
()
))
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
DeviceInfo
().
has
(
ATOMICS
))
callers
=
singlepass_callers
;
callers
=
singlepass_callers
;
Caller
caller
=
callers
[
src
.
depth
()];
Caller
caller
=
callers
[
src
.
depth
()];
...
@@ -206,7 +206,7 @@ Scalar cv::gpu::sqrSum(const GpuMat& src, GpuMat& buf)
...
@@ -206,7 +206,7 @@ Scalar cv::gpu::sqrSum(const GpuMat& src, GpuMat& buf)
sqrSumCaller
<
int
>
,
sqrSumCaller
<
float
>
,
0
};
sqrSumCaller
<
int
>
,
sqrSumCaller
<
float
>
,
0
};
Caller
*
callers
=
multipass_callers
;
Caller
*
callers
=
multipass_callers
;
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
hasAtomicsSupport
(
getDevice
()
))
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
DeviceInfo
().
has
(
ATOMICS
))
callers
=
singlepass_callers
;
callers
=
singlepass_callers
;
Size
buf_size
;
Size
buf_size
;
...
@@ -284,7 +284,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
...
@@ -284,7 +284,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8U
&&
src
.
size
()
==
mask
.
size
()));
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8U
&&
src
.
size
()
==
mask
.
size
()));
CV_Assert
(
src
.
type
()
!=
CV_64F
||
(
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
CV_Assert
(
src
.
type
()
!=
CV_64F
||
(
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
hasNativeDoubleSupport
(
getDevice
()
)));
DeviceInfo
().
has
(
NATIVE_DOUBLE
)));
double
minVal_
;
if
(
!
minVal
)
minVal
=
&
minVal_
;
double
minVal_
;
if
(
!
minVal
)
minVal
=
&
minVal_
;
double
maxVal_
;
if
(
!
maxVal
)
maxVal
=
&
maxVal_
;
double
maxVal_
;
if
(
!
maxVal
)
maxVal
=
&
maxVal_
;
...
@@ -296,7 +296,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
...
@@ -296,7 +296,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
if
(
mask
.
empty
())
if
(
mask
.
empty
())
{
{
Caller
*
callers
=
multipass_callers
;
Caller
*
callers
=
multipass_callers
;
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
hasAtomicsSupport
(
getDevice
()
))
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
DeviceInfo
().
has
(
ATOMICS
))
callers
=
singlepass_callers
;
callers
=
singlepass_callers
;
Caller
caller
=
callers
[
src
.
type
()];
Caller
caller
=
callers
[
src
.
type
()];
...
@@ -306,7 +306,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
...
@@ -306,7 +306,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp
else
else
{
{
MaskedCaller
*
callers
=
masked_multipass_callers
;
MaskedCaller
*
callers
=
masked_multipass_callers
;
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
hasAtomicsSupport
(
getDevice
()
))
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
DeviceInfo
().
has
(
ATOMICS
))
callers
=
masked_singlepass_callers
;
callers
=
masked_singlepass_callers
;
MaskedCaller
caller
=
callers
[
src
.
type
()];
MaskedCaller
caller
=
callers
[
src
.
type
()];
...
@@ -383,7 +383,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
...
@@ -383,7 +383,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8U
&&
src
.
size
()
==
mask
.
size
()));
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8U
&&
src
.
size
()
==
mask
.
size
()));
CV_Assert
(
src
.
type
()
!=
CV_64F
||
(
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
CV_Assert
(
src
.
type
()
!=
CV_64F
||
(
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
hasNativeDoubleSupport
(
getDevice
()
)));
DeviceInfo
().
has
(
NATIVE_DOUBLE
)));
double
minVal_
;
if
(
!
minVal
)
minVal
=
&
minVal_
;
double
minVal_
;
if
(
!
minVal
)
minVal
=
&
minVal_
;
double
maxVal_
;
if
(
!
maxVal
)
maxVal
=
&
maxVal_
;
double
maxVal_
;
if
(
!
maxVal
)
maxVal
=
&
maxVal_
;
...
@@ -399,7 +399,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
...
@@ -399,7 +399,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
if
(
mask
.
empty
())
if
(
mask
.
empty
())
{
{
Caller
*
callers
=
multipass_callers
;
Caller
*
callers
=
multipass_callers
;
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
hasAtomicsSupport
(
getDevice
()
))
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
DeviceInfo
().
has
(
ATOMICS
))
callers
=
singlepass_callers
;
callers
=
singlepass_callers
;
Caller
caller
=
callers
[
src
.
type
()];
Caller
caller
=
callers
[
src
.
type
()];
...
@@ -409,7 +409,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
...
@@ -409,7 +409,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point
else
else
{
{
MaskedCaller
*
callers
=
masked_multipass_callers
;
MaskedCaller
*
callers
=
masked_multipass_callers
;
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
hasAtomicsSupport
(
getDevice
()
))
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
DeviceInfo
().
has
(
ATOMICS
))
callers
=
masked_singlepass_callers
;
callers
=
masked_singlepass_callers
;
MaskedCaller
caller
=
callers
[
src
.
type
()];
MaskedCaller
caller
=
callers
[
src
.
type
()];
...
@@ -464,14 +464,14 @@ int cv::gpu::countNonZero(const GpuMat& src, GpuMat& buf)
...
@@ -464,14 +464,14 @@ int cv::gpu::countNonZero(const GpuMat& src, GpuMat& buf)
CV_Assert
(
src
.
channels
()
==
1
);
CV_Assert
(
src
.
channels
()
==
1
);
CV_Assert
(
src
.
type
()
!=
CV_64F
||
(
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
CV_Assert
(
src
.
type
()
!=
CV_64F
||
(
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
hasNativeDoubleSupport
(
getDevice
()
)));
DeviceInfo
().
has
(
NATIVE_DOUBLE
)));
Size
buf_size
;
Size
buf_size
;
getBufSizeRequired
(
src
.
cols
,
src
.
rows
,
buf_size
.
width
,
buf_size
.
height
);
getBufSizeRequired
(
src
.
cols
,
src
.
rows
,
buf_size
.
width
,
buf_size
.
height
);
ensureSizeIsEnough
(
buf_size
,
CV_8U
,
buf
);
ensureSizeIsEnough
(
buf_size
,
CV_8U
,
buf
);
Caller
*
callers
=
multipass_callers
;
Caller
*
callers
=
multipass_callers
;
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
hasAtomicsSupport
(
getDevice
()
))
if
(
TargetArchs
::
builtWith
(
ATOMICS
)
&&
DeviceInfo
().
has
(
ATOMICS
))
callers
=
singlepass_callers
;
callers
=
singlepass_callers
;
Caller
caller
=
callers
[
src
.
type
()];
Caller
caller
=
callers
[
src
.
type
()];
...
...
modules/gpu/src/split_merge.cpp
View file @
575fd1fe
...
@@ -74,7 +74,7 @@ namespace cv { namespace gpu { namespace split_merge
...
@@ -74,7 +74,7 @@ namespace cv { namespace gpu { namespace split_merge
CV_Assert
(
n
>
0
);
CV_Assert
(
n
>
0
);
bool
double_ok
=
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
bool
double_ok
=
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
hasNativeDoubleSupport
(
getDevice
()
);
DeviceInfo
().
has
(
NATIVE_DOUBLE
);
CV_Assert
(
src
[
0
].
depth
()
!=
CV_64F
||
double_ok
);
CV_Assert
(
src
[
0
].
depth
()
!=
CV_64F
||
double_ok
);
int
depth
=
src
[
0
].
depth
();
int
depth
=
src
[
0
].
depth
();
...
@@ -117,7 +117,7 @@ namespace cv { namespace gpu { namespace split_merge
...
@@ -117,7 +117,7 @@ namespace cv { namespace gpu { namespace split_merge
CV_Assert
(
dst
);
CV_Assert
(
dst
);
bool
double_ok
=
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
bool
double_ok
=
TargetArchs
::
builtWith
(
NATIVE_DOUBLE
)
&&
hasNativeDoubleSupport
(
getDevice
()
);
DeviceInfo
().
has
(
NATIVE_DOUBLE
);
CV_Assert
(
src
.
depth
()
!=
CV_64F
||
double_ok
);
CV_Assert
(
src
.
depth
()
!=
CV_64F
||
double_ok
);
int
depth
=
src
.
depth
();
int
depth
=
src
.
depth
();
...
...
modules/gpu/src/stereobm.cpp
View file @
575fd1fe
...
@@ -86,13 +86,9 @@ bool cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable()
...
@@ -86,13 +86,9 @@ bool cv::gpu::StereoBM_GPU::checkIfGpuCallReasonable()
if
(
0
==
getCudaEnabledDeviceCount
())
if
(
0
==
getCudaEnabledDeviceCount
())
return
false
;
return
false
;
int
device
=
getDevice
()
;
DeviceInfo
device_info
;
int
minor
,
major
;
if
(
device_info
.
major
()
>
1
||
device_info
.
multiProcessorCount
()
>
16
)
getComputeCapability
(
device
,
major
,
minor
);
int
numSM
=
getNumberOfSMs
(
device
);
if
(
major
>
1
||
numSM
>
16
)
return
true
;
return
true
;
return
false
;
return
false
;
...
...
modules/gpu/src/surf.cpp
View file @
575fd1fe
...
@@ -104,7 +104,7 @@ namespace
...
@@ -104,7 +104,7 @@ namespace
CV_Assert
(
img
.
type
()
==
CV_8UC1
);
CV_Assert
(
img
.
type
()
==
CV_8UC1
);
CV_Assert
(
mask
.
empty
()
||
(
mask
.
size
()
==
img
.
size
()
&&
mask
.
type
()
==
CV_8UC1
));
CV_Assert
(
mask
.
empty
()
||
(
mask
.
size
()
==
img
.
size
()
&&
mask
.
type
()
==
CV_8UC1
));
CV_Assert
(
nOctaves
>
0
&&
nIntervals
>
2
);
CV_Assert
(
nOctaves
>
0
&&
nIntervals
>
2
);
CV_Assert
(
hasAtomicsSupport
(
getDevice
()
));
CV_Assert
(
DeviceInfo
().
has
(
ATOMICS
));
max_features
=
static_cast
<
int
>
(
img
.
size
().
area
()
*
featuresRatio
);
max_features
=
static_cast
<
int
>
(
img
.
size
().
area
()
*
featuresRatio
);
max_candidates
=
static_cast
<
int
>
(
1.5
*
max_features
);
max_candidates
=
static_cast
<
int
>
(
1.5
*
max_features
);
...
...
tests/gpu/src/arithm.cpp
View file @
575fd1fe
...
@@ -660,7 +660,7 @@ struct CV_GpuMinMaxTest: public CvTest
...
@@ -660,7 +660,7 @@ struct CV_GpuMinMaxTest: public CvTest
try
try
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
...
@@ -794,7 +794,7 @@ struct CV_GpuMinMaxLocTest: public CvTest
...
@@ -794,7 +794,7 @@ struct CV_GpuMinMaxLocTest: public CvTest
try
try
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
...
@@ -875,7 +875,7 @@ struct CV_GpuCountNonZeroTest: CvTest
...
@@ -875,7 +875,7 @@ struct CV_GpuCountNonZeroTest: CvTest
try
try
{
{
int
depth_end
;
int
depth_end
;
if
(
cv
::
gpu
::
hasNativeDoubleSupport
(
cv
::
gpu
::
getDevice
()
))
if
(
cv
::
gpu
::
DeviceInfo
().
has
(
cv
::
gpu
::
NATIVE_DOUBLE
))
depth_end
=
CV_64F
;
depth_end
=
CV_64F
;
else
else
depth_end
=
CV_32F
;
depth_end
=
CV_32F
;
...
...
tests/gpu/src/bitwise_oper.cpp
View file @
575fd1fe
...
@@ -60,7 +60,7 @@ struct CV_GpuBitwiseTest: public CvTest
...
@@ -60,7 +60,7 @@ struct CV_GpuBitwiseTest: public CvTest
int
rows
,
cols
;
int
rows
,
cols
;
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
int
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
for
(
int
depth
=
CV_8U
;
depth
<=
depth_end
;
++
depth
)
...
...
tests/gpu/src/match_template.cpp
View file @
575fd1fe
...
@@ -65,7 +65,7 @@ struct CV_GpuMatchTemplateTest: CvTest
...
@@ -65,7 +65,7 @@ struct CV_GpuMatchTemplateTest: CvTest
try
try
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
if
(
!
double_ok
)
if
(
!
double_ok
)
{
{
// For sqrIntegral
// For sqrIntegral
...
@@ -245,7 +245,7 @@ struct CV_GpuMatchTemplateFindPatternInBlackTest: CvTest
...
@@ -245,7 +245,7 @@ struct CV_GpuMatchTemplateFindPatternInBlackTest: CvTest
try
try
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
if
(
!
double_ok
)
if
(
!
double_ok
)
{
{
// For sqrIntegral
// For sqrIntegral
...
...
tests/gpu/src/meanshift.cpp
View file @
575fd1fe
...
@@ -54,12 +54,9 @@ struct CV_GpuMeanShiftTest : public CvTest
...
@@ -54,12 +54,9 @@ struct CV_GpuMeanShiftTest : public CvTest
int
colorRad
=
30
;
int
colorRad
=
30
;
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
;
int
major
,
minor
;
if
(
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreater
(
2
,
0
)
&&
cv
::
gpu
::
DeviceInfo
().
major
()
>=
2
)
cv
::
gpu
::
getComputeCapability
(
cv
::
gpu
::
getDevice
(),
major
,
minor
);
if
(
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreater
(
2
,
0
)
&&
major
>=
2
)
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"
);
...
@@ -202,10 +199,7 @@ struct CV_GpuMeanShiftProcTest : public CvTest
...
@@ -202,10 +199,7 @@ struct CV_GpuMeanShiftProcTest : public CvTest
cv
::
Mat
spmap_template
;
cv
::
Mat
spmap_template
;
cv
::
FileStorage
fs
;
cv
::
FileStorage
fs
;
int
major
,
minor
;
if
(
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreater
(
2
,
0
)
&&
cv
::
gpu
::
DeviceInfo
().
major
()
>=
2
)
cv
::
gpu
::
getComputeCapability
(
cv
::
gpu
::
getDevice
(),
major
,
minor
);
if
(
cv
::
gpu
::
TargetArchs
::
hasEqualOrGreater
(
2
,
0
)
&&
major
>=
2
)
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 @
575fd1fe
...
@@ -63,15 +63,13 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
...
@@ -63,15 +63,13 @@ struct CV_GpuMeanShiftSegmentationTest : public CvTest {
Mat
img
;
Mat
img
;
cvtColor
(
img_rgb
,
img
,
CV_BGR2BGRA
);
cvtColor
(
img_rgb
,
img
,
CV_BGR2BGRA
);
int
major
,
minor
;
cv
::
gpu
::
getComputeCapability
(
cv
::
gpu
::
getDevice
(),
major
,
minor
);
for
(
int
minsize
=
0
;
minsize
<
2000
;
minsize
=
(
minsize
+
1
)
*
4
)
for
(
int
minsize
=
0
;
minsize
<
2000
;
minsize
=
(
minsize
+
1
)
*
4
)
{
{
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
::
hasEqualOrGreater
(
2
,
0
)
&&
major
>=
2
)
if
(
TargetArchs
::
hasEqualOrGreater
(
2
,
0
)
&&
DeviceInfo
().
major
()
>=
2
)
path
<<
".png"
;
path
<<
".png"
;
else
else
path
<<
"_CC1X.png"
;
path
<<
"_CC1X.png"
;
...
...
tests/gpu/src/split_merge.cpp
View file @
575fd1fe
...
@@ -64,7 +64,7 @@ struct CV_MergeTest : public CvTest
...
@@ -64,7 +64,7 @@ struct CV_MergeTest : public CvTest
void
CV_MergeTest
::
can_merge
(
size_t
rows
,
size_t
cols
)
void
CV_MergeTest
::
can_merge
(
size_t
rows
,
size_t
cols
)
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
...
@@ -106,7 +106,7 @@ void CV_MergeTest::can_merge(size_t rows, size_t cols)
...
@@ -106,7 +106,7 @@ void CV_MergeTest::can_merge(size_t rows, size_t cols)
void
CV_MergeTest
::
can_merge_submatrixes
(
size_t
rows
,
size_t
cols
)
void
CV_MergeTest
::
can_merge_submatrixes
(
size_t
rows
,
size_t
cols
)
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
...
@@ -180,7 +180,7 @@ struct CV_SplitTest : public CvTest
...
@@ -180,7 +180,7 @@ struct CV_SplitTest : public CvTest
void
CV_SplitTest
::
can_split
(
size_t
rows
,
size_t
cols
)
void
CV_SplitTest
::
can_split
(
size_t
rows
,
size_t
cols
)
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
...
@@ -222,7 +222,7 @@ void CV_SplitTest::can_split(size_t rows, size_t cols)
...
@@ -222,7 +222,7 @@ void CV_SplitTest::can_split(size_t rows, size_t cols)
void
CV_SplitTest
::
can_split_submatrix
(
size_t
rows
,
size_t
cols
)
void
CV_SplitTest
::
can_split_submatrix
(
size_t
rows
,
size_t
cols
)
{
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
...
@@ -293,7 +293,7 @@ struct CV_SplitMergeTest : public CvTest
...
@@ -293,7 +293,7 @@ struct CV_SplitMergeTest : public CvTest
void
CV_SplitMergeTest
::
can_split_merge
(
size_t
rows
,
size_t
cols
)
{
void
CV_SplitMergeTest
::
can_split_merge
(
size_t
rows
,
size_t
cols
)
{
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
bool
double_ok
=
gpu
::
TargetArchs
::
builtWith
(
gpu
::
NATIVE_DOUBLE
)
&&
gpu
::
hasNativeDoubleSupport
(
gpu
::
getDevice
()
);
gpu
::
DeviceInfo
().
has
(
gpu
::
NATIVE_DOUBLE
);
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
size_t
depth_end
=
double_ok
?
CV_64F
:
CV_32F
;
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
...
...
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