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
2f8af633
Commit
2f8af633
authored
Feb 15, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed GpuFeature into FeatureSet and updated docs
parent
04709a27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
gpu_initialization.tex
doc/gpu_initialization.tex
+7
-7
opencv.pdf
doc/opencv.pdf
+0
-0
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+3
-3
initialization.cpp
modules/gpu/src/initialization.cpp
+8
-5
No files found.
doc/gpu_initialization.tex
View file @
2f8af633
...
...
@@ -22,11 +22,11 @@ Returns the current device index, which was set by {gpu::getDevice} or initializ
\cvdefCpp
{
int getDevice();
}
\cvclass
{
gpu::
GpuFeature
}
\label
{
cpp.gpu.GpuFeature
}
\cvclass
{
gpu::
FeatureSet
}
\label
{
cpp.gpu.FeatureSet
}
GPU compute features.
\begin{lstlisting}
enum
GpuFeature
enum
FeatureSet
{
FEATURE
_
SET
_
COMPUTE
_
10, FEATURE
_
SET
_
COMPUTE
_
11,
FEATURE
_
SET
_
COMPUTE
_
12, FEATURE
_
SET
_
COMPUTE
_
13,
...
...
@@ -56,7 +56,7 @@ public:
size
_
t freeMemory() const;
size
_
t totalMemory() const;
bool supports(
GpuFeature feature
) const;
bool supports(
FeatureSet feature
_
set
) const;
bool isCompatible() const;
}
;
\end{lstlisting}
...
...
@@ -111,9 +111,9 @@ Returns the amount of total memory in bytes.
\cvCppFunc
{
gpu::DeviceInfo::supports
}
Returns true if the device has the given GPU feature, otherwise false.
\cvdefCpp
{
bool DeviceInfo::supports(
GpuFeature feature
);
}
\cvdefCpp
{
bool DeviceInfo::supports(
FeatureSet feature
\_
set
);
}
\begin{description}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.
GpuFeature]
{
cv::gpu::GpuFeature
}
.
}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.
FeatureSet]
{
cv::gpu::FeatureSet
}
.
}
\end{description}
...
...
@@ -129,9 +129,9 @@ This class provides functionality (as set of static methods) for checking which
\bigskip
The following method checks whether the module was built with the support of the given feature:
\cvdefCpp
{
static bool builtWith(
GpuFeature feature
);
}
\cvdefCpp
{
static bool builtWith(
FeatureSet feature
\_
set
);
}
\begin{description}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.
GpuFeature]
{
cv::gpu::GpuFeature
}
.
}
\cvarg
{
feature
}{
Feature to be checked. See
\hyperref
[cpp.gpu.
FeatureSet]
{
cv::gpu::FeatureSet
}
.
}
\end{description}
There are a set of methods for checking whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
...
...
doc/opencv.pdf
View file @
2f8af633
This diff is collapsed.
Click to expand it.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
2f8af633
...
...
@@ -64,7 +64,7 @@ namespace cv
CV_EXPORTS
void
setDevice
(
int
device
);
CV_EXPORTS
int
getDevice
();
enum
GpuFeature
enum
FeatureSet
{
FEATURE_SET_COMPUTE_10
=
10
,
FEATURE_SET_COMPUTE_11
=
11
,
...
...
@@ -81,7 +81,7 @@ namespace cv
class
CV_EXPORTS
TargetArchs
{
public
:
static
bool
builtWith
(
GpuFeature
feature
);
static
bool
builtWith
(
FeatureSet
feature_set
);
static
bool
has
(
int
major
,
int
minor
);
static
bool
hasPtx
(
int
major
,
int
minor
);
static
bool
hasBin
(
int
major
,
int
minor
);
...
...
@@ -115,7 +115,7 @@ namespace cv
size_t
totalMemory
()
const
;
// Checks whether device supports the given feature
bool
supports
(
GpuFeature
feature
)
const
;
bool
supports
(
FeatureSet
feature_set
)
const
;
// Checks whether the GPU module can be run on the given device
bool
isCompatible
()
const
;
...
...
modules/gpu/src/initialization.cpp
View file @
2f8af633
...
...
@@ -48,6 +48,9 @@ using namespace cv::gpu;
namespace
{
// Compares value to set using the given comparator. Returns true if
// there is at least one element x in the set satisfying to: x cmp value
// predicate.
template
<
typename
Comparer
>
bool
compareToSet
(
const
std
::
string
&
set_as_str
,
int
value
,
Comparer
cmp
)
{
...
...
@@ -69,9 +72,9 @@ namespace
}
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
builtWith
(
cv
::
gpu
::
GpuFeature
feature
)
CV_EXPORTS
bool
cv
::
gpu
::
TargetArchs
::
builtWith
(
cv
::
gpu
::
FeatureSet
feature_set
)
{
return
::
compareToSet
(
CUDA_ARCH_FEATURES
,
feature
,
std
::
greater_equal
<
int
>
());
return
::
compareToSet
(
CUDA_ARCH_FEATURES
,
feature
_set
,
std
::
greater_equal
<
int
>
());
}
...
...
@@ -128,7 +131,7 @@ CV_EXPORTS void cv::gpu::setDevice(int) { throw_nogpu(); }
CV_EXPORTS
int
cv
::
gpu
::
getDevice
()
{
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
::
supports
(
cv
::
gpu
::
GpuFeature
)
const
{
throw_nogpu
();
return
false
;
}
bool
cv
::
gpu
::
DeviceInfo
::
supports
(
cv
::
gpu
::
FeatureSet
)
const
{
throw_nogpu
();
return
false
;
}
bool
cv
::
gpu
::
DeviceInfo
::
isCompatible
()
const
{
throw_nogpu
();
return
false
;
}
void
cv
::
gpu
::
DeviceInfo
::
query
()
{
throw_nogpu
();
}
void
cv
::
gpu
::
DeviceInfo
::
queryMemory
(
size_t
&
,
size_t
&
)
const
{
throw_nogpu
();
}
...
...
@@ -173,10 +176,10 @@ size_t cv::gpu::DeviceInfo::totalMemory() const
}
bool
cv
::
gpu
::
DeviceInfo
::
supports
(
cv
::
gpu
::
GpuFeature
feature
)
const
bool
cv
::
gpu
::
DeviceInfo
::
supports
(
cv
::
gpu
::
FeatureSet
feature_set
)
const
{
int
version
=
majorVersion
()
*
10
+
minorVersion
();
return
version
>=
feature
;
return
version
>=
feature
_set
;
}
...
...
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