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
186b1fc6
Commit
186b1fc6
authored
Jan 19, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored gpu module
parent
90ae1e3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
33 deletions
+30
-33
initialization.cpp
modules/gpu/src/initialization.cpp
+24
-27
match_template.cpp
tests/gpu/src/match_template.cpp
+6
-6
No files found.
modules/gpu/src/initialization.cpp
View file @
186b1fc6
...
...
@@ -57,6 +57,9 @@ CV_EXPORTS int cv::gpu::getNumberOfSMs(int /*device*/) { throw_nogpu(); return 0
CV_EXPORTS
void
cv
::
gpu
::
getGpuMemInfo
(
size_t
&
/*free*/
,
size_t
&
/*total*/
)
{
throw_nogpu
();
}
CV_EXPORTS
bool
cv
::
gpu
::
hasNativeDoubleSupport
(
int
/*device*/
)
{
throw_nogpu
();
return
false
;
}
CV_EXPORTS
bool
cv
::
gpu
::
hasAtomicsSupport
(
int
/*device*/
)
{
throw_nogpu
();
return
false
;
}
CV_EXPORTS
bool
cv
::
gpu
::
ptxVersionIs
(
int
major
,
int
minor
)
{
throw_nogpu
();
return
false
;
}
CV_EXPORTS
bool
cv
::
gpu
::
ptxVersionIsLessOrEqual
(
int
major
,
int
minor
)
{
throw_nogpu
();
return
false
;
}
CV_EXPORTS
bool
cv
::
gpu
::
ptxVersionIsGreaterOrEqual
(
int
major
,
int
minor
)
{
throw_nogpu
();
return
false
;
}
#else
/* !defined (HAVE_CUDA) */
...
...
@@ -133,33 +136,6 @@ CV_EXPORTS bool cv::gpu::hasAtomicsSupport(int device)
namespace
{
struct
ComparerEqual
{
bool
operator
()(
int
lhs1
,
int
lhs2
,
int
rhs1
,
int
rhs2
)
const
{
return
lhs1
==
rhs1
&&
lhs2
==
rhs2
;
}
};
struct
ComparerLessOrEqual
{
bool
operator
()(
int
lhs1
,
int
lhs2
,
int
rhs1
,
int
rhs2
)
const
{
return
lhs1
<
rhs1
||
(
lhs1
==
rhs1
&&
lhs2
<=
rhs2
);
}
};
struct
ComparerGreaterOrEqual
{
bool
operator
()(
int
lhs1
,
int
lhs2
,
int
rhs1
,
int
rhs2
)
const
{
return
lhs1
>
rhs1
||
(
lhs1
==
rhs1
&&
lhs2
>=
rhs2
);
}
};
template
<
typename
Comparer
>
bool
checkPtxVersion
(
int
major
,
int
minor
,
Comparer
cmp
)
{
...
...
@@ -194,18 +170,39 @@ namespace
CV_EXPORTS
bool
cv
::
gpu
::
ptxVersionIs
(
int
major
,
int
minor
)
{
struct
ComparerEqual
{
bool
operator
()(
int
lhs1
,
int
lhs2
,
int
rhs1
,
int
rhs2
)
const
{
return
lhs1
==
rhs1
&&
lhs2
==
rhs2
;
}
};
return
checkPtxVersion
(
major
,
minor
,
ComparerEqual
());
}
CV_EXPORTS
bool
cv
::
gpu
::
ptxVersionIsLessOrEqual
(
int
major
,
int
minor
)
{
struct
ComparerLessOrEqual
{
bool
operator
()(
int
lhs1
,
int
lhs2
,
int
rhs1
,
int
rhs2
)
const
{
return
lhs1
<
rhs1
||
(
lhs1
==
rhs1
&&
lhs2
<=
rhs2
);
}
};
return
checkPtxVersion
(
major
,
minor
,
ComparerLessOrEqual
());
}
CV_EXPORTS
bool
cv
::
gpu
::
ptxVersionIsGreaterOrEqual
(
int
major
,
int
minor
)
{
struct
ComparerGreaterOrEqual
{
bool
operator
()(
int
lhs1
,
int
lhs2
,
int
rhs1
,
int
rhs2
)
const
{
return
lhs1
>
rhs1
||
(
lhs1
==
rhs1
&&
lhs2
>=
rhs2
);
}
};
return
checkPtxVersion
(
major
,
minor
,
ComparerGreaterOrEqual
());
}
...
...
tests/gpu/src/match_template.cpp
View file @
186b1fc6
...
...
@@ -234,21 +234,21 @@ struct CV_GpuMatchTemplateFindPatternInBlackTest: CvTest
{
try
{
Mat
image
=
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"matchtemplate/black.
jp
g"
);
Mat
image
=
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"matchtemplate/black.
pn
g"
);
if
(
image
.
empty
())
{
ts
->
printf
(
CvTS
::
CONSOLE
,
"can't open file '%s'"
,
(
std
::
string
(
ts
->
get_data_path
())
+
"matchtemplate/black.
jp
g"
).
c_str
());
ts
->
set_failed_test_info
(
CvTS
::
FAIL_
INVALID
_TEST_DATA
);
+
"matchtemplate/black.
pn
g"
).
c_str
());
ts
->
set_failed_test_info
(
CvTS
::
FAIL_
MISSING
_TEST_DATA
);
return
;
}
Mat
pattern
=
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"matchtemplate/cat.
jp
g"
);
Mat
pattern
=
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"matchtemplate/cat.
pn
g"
);
if
(
pattern
.
empty
())
{
ts
->
printf
(
CvTS
::
CONSOLE
,
"can't open file '%s'"
,
(
std
::
string
(
ts
->
get_data_path
())
+
"matchtemplate/cat.
jp
g"
).
c_str
());
ts
->
set_failed_test_info
(
CvTS
::
FAIL_
INVALID
_TEST_DATA
);
+
"matchtemplate/cat.
pn
g"
).
c_str
());
ts
->
set_failed_test_info
(
CvTS
::
FAIL_
MISSING
_TEST_DATA
);
return
;
}
...
...
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