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
b4e7ee46
Commit
b4e7ee46
authored
Dec 24, 2014
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compilation without CUDA
parent
cd0e95de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
10 deletions
+32
-10
private.cuda.hpp
modules/core/include/opencv2/core/private.cuda.hpp
+10
-10
cuda_gpu_mat.cpp
modules/core/src/cuda_gpu_mat.cpp
+22
-0
No files found.
modules/core/include/opencv2/core/private.cuda.hpp
View file @
b4e7ee46
...
...
@@ -80,6 +80,16 @@
namespace
cv
{
namespace
cuda
{
CV_EXPORTS
cv
::
String
getNppErrorMessage
(
int
code
);
CV_EXPORTS
cv
::
String
getCudaDriverApiErrorMessage
(
int
code
);
CV_EXPORTS
GpuMat
getInputMat
(
InputArray
_src
,
Stream
&
stream
);
CV_EXPORTS
GpuMat
getOutputMat
(
OutputArray
_dst
,
int
rows
,
int
cols
,
int
type
,
Stream
&
stream
);
static
inline
GpuMat
getOutputMat
(
OutputArray
_dst
,
Size
size
,
int
type
,
Stream
&
stream
)
{
return
getOutputMat
(
_dst
,
size
.
height
,
size
.
width
,
type
,
stream
);
}
CV_EXPORTS
void
syncOutput
(
const
GpuMat
&
dst
,
OutputArray
_dst
,
Stream
&
stream
);
}}
#ifndef HAVE_CUDA
...
...
@@ -106,16 +116,6 @@ namespace cv { namespace cuda
GpuMat
::
Allocator
*
allocator_
;
};
CV_EXPORTS
GpuMat
getInputMat
(
InputArray
_src
,
Stream
&
stream
);
CV_EXPORTS
GpuMat
getOutputMat
(
OutputArray
_dst
,
int
rows
,
int
cols
,
int
type
,
Stream
&
stream
);
static
inline
GpuMat
getOutputMat
(
OutputArray
_dst
,
Size
size
,
int
type
,
Stream
&
stream
)
{
return
getOutputMat
(
_dst
,
size
.
height
,
size
.
width
,
type
,
stream
);
}
CV_EXPORTS
void
syncOutput
(
const
GpuMat
&
dst
,
OutputArray
_dst
,
Stream
&
stream
);
static
inline
void
checkNppError
(
int
code
,
const
char
*
file
,
const
int
line
,
const
char
*
func
)
{
if
(
code
<
0
)
...
...
modules/core/src/cuda_gpu_mat.cpp
View file @
b4e7ee46
...
...
@@ -346,6 +346,11 @@ GpuMat cv::cuda::getInputMat(InputArray _src, Stream& stream)
{
GpuMat
src
;
#ifndef HAVE_CUDA
(
void
)
_src
;
(
void
)
stream
;
throw_no_cuda
();
#else
if
(
_src
.
kind
()
==
_InputArray
::
CUDA_GPU_MAT
)
{
src
=
_src
.
getGpuMat
();
...
...
@@ -356,6 +361,7 @@ GpuMat cv::cuda::getInputMat(InputArray _src, Stream& stream)
src
=
pool
.
getBuffer
(
_src
.
size
(),
_src
.
type
());
src
.
upload
(
_src
,
stream
);
}
#endif
return
src
;
}
...
...
@@ -364,6 +370,14 @@ GpuMat cv::cuda::getOutputMat(OutputArray _dst, int rows, int cols, int type, St
{
GpuMat
dst
;
#ifndef HAVE_CUDA
(
void
)
_dst
;
(
void
)
rows
;
(
void
)
cols
;
(
void
)
type
;
(
void
)
stream
;
throw_no_cuda
();
#else
if
(
_dst
.
kind
()
==
_InputArray
::
CUDA_GPU_MAT
)
{
_dst
.
create
(
rows
,
cols
,
type
);
...
...
@@ -374,12 +388,19 @@ GpuMat cv::cuda::getOutputMat(OutputArray _dst, int rows, int cols, int type, St
BufferPool
pool
(
stream
);
dst
=
pool
.
getBuffer
(
rows
,
cols
,
type
);
}
#endif
return
dst
;
}
void
cv
::
cuda
::
syncOutput
(
const
GpuMat
&
dst
,
OutputArray
_dst
,
Stream
&
stream
)
{
#ifndef HAVE_CUDA
(
void
)
dst
;
(
void
)
_dst
;
(
void
)
stream
;
throw_no_cuda
();
#else
if
(
_dst
.
kind
()
!=
_InputArray
::
CUDA_GPU_MAT
)
{
if
(
stream
)
...
...
@@ -387,6 +408,7 @@ void cv::cuda::syncOutput(const GpuMat& dst, OutputArray _dst, Stream& stream)
else
dst
.
download
(
_dst
);
}
#endif
}
#ifndef HAVE_CUDA
...
...
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