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
2509fa80
Commit
2509fa80
authored
Dec 19, 2013
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warious fixes for case where HAVE_CUDA==OFF.
parent
5a5c82bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
24 deletions
+23
-24
CMakeLists.txt
modules/core/CMakeLists.txt
+0
-4
gpumat.cpp
modules/core/src/gpumat.cpp
+7
-15
CMakeLists.txt
modules/dynamicuda/CMakeLists.txt
+1
-1
dynamicuda.hpp
modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp
+15
-4
No files found.
modules/core/CMakeLists.txt
View file @
2509fa80
set
(
the_description
"The Core Functionality"
)
message
(
STATUS
"ENABLE_DYNAMIC_CUDA
${
ENABLE_DYNAMIC_CUDA
}
"
)
if
(
ENABLE_DYNAMIC_CUDA
)
message
(
STATUS
"Using dynamic cuda approach"
)
ocv_add_module
(
core PRIVATE_REQUIRED
${
ZLIB_LIBRARIES
}
)
else
()
message
(
STATUS
"Link CUDA statically"
)
ocv_add_module
(
core PRIVATE_REQUIRED
${
ZLIB_LIBRARIES
}
${
CUDA_LIBRARIES
}
${
CUDA_npp_LIBRARY
}
)
endif
()
...
...
modules/core/src/gpumat.cpp
View file @
2509fa80
...
...
@@ -44,7 +44,7 @@
#include "opencv2/core/gpumat.hpp"
#include <iostream>
#if defined(HAVE_CUDA)
|| defined(DYNAMIC_CUDA_SUPPORT)
#if defined(HAVE_CUDA)
#include <cuda_runtime.h>
#include <npp.h>
...
...
@@ -273,8 +273,6 @@ void cv::gpu::DeviceInfo::query() { deviceInfoFuncTable()->query(); }
void
cv
::
gpu
::
printCudaDeviceInfo
(
int
device
)
{
deviceInfoFuncTable
()
->
printCudaDeviceInfo
(
device
);
}
void
cv
::
gpu
::
printShortCudaDeviceInfo
(
int
device
)
{
deviceInfoFuncTable
()
->
printShortCudaDeviceInfo
(
device
);
}
#ifdef HAVE_CUDA
namespace
cv
{
namespace
gpu
{
CV_EXPORTS
void
copyWithMask
(
const
cv
::
gpu
::
GpuMat
&
,
cv
::
gpu
::
GpuMat
&
,
const
cv
::
gpu
::
GpuMat
&
,
cudaStream_t
);
...
...
@@ -286,8 +284,6 @@ namespace cv { namespace gpu
CV_EXPORTS
void
setTo
(
cv
::
gpu
::
GpuMat
&
,
cv
::
Scalar
,
const
cv
::
gpu
::
GpuMat
&
);
}}
#endif
//////////////////////////////// GpuMat ///////////////////////////////
cv
::
gpu
::
GpuMat
::
GpuMat
(
const
GpuMat
&
m
)
...
...
@@ -707,43 +703,39 @@ void cv::gpu::GpuMat::release()
refcount
=
0
;
}
#ifdef HAVE_CUDA
namespace
cv
{
namespace
gpu
{
void
convertTo
(
const
GpuMat
&
src
,
GpuMat
&
dst
)
{
gpuFuncTable
()
->
convert
(
src
,
dst
);
}
void
convertTo
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
double
alpha
,
double
beta
,
cudaStream_t
stream
)
{
gpuFuncTable
()
->
convert
(
src
,
dst
,
alpha
,
beta
,
stream
);
}
void
setTo
(
GpuMat
&
src
,
Scalar
s
,
cudaStream_t
stream
)
{
gpuFuncTable
()
->
setTo
(
src
,
s
,
cv
::
gpu
::
GpuMat
(),
stream
);
}
void
setTo
(
GpuMat
&
src
,
Scalar
s
,
const
GpuMat
&
mask
,
cudaStream_t
stream
)
{
gpuFuncTable
()
->
setTo
(
src
,
s
,
mask
,
stream
);
gpuFuncTable
()
->
setTo
(
src
,
s
,
mask
,
stream
);
}
void
setTo
(
GpuMat
&
src
,
Scalar
s
)
{
setTo
(
src
,
s
,
0
);
}
void
setTo
(
GpuMat
&
src
,
Scalar
s
,
const
GpuMat
&
mask
)
{
setTo
(
src
,
s
,
mask
,
0
);
}
}}
#endif
////////////////////////////////////////////////////////////////////////
// Error handling
...
...
modules/dynamicuda/CMakeLists.txt
View file @
2509fa80
if
(
NOT ANDROID
)
if
(
NOT ANDROID
OR NOT HAVE_CUDA
)
ocv_module_disable
(
dynamicuda
)
endif
()
...
...
modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp
View file @
2509fa80
#ifndef __GPUMAT_CUDA_HPP__
#define __GPUMAT_CUDA_HPP__
#ifndef HAVE_CUDA
typedef
void
*
cudaStream_t
;
#endif
class
DeviceInfoFuncTable
{
public
:
...
...
@@ -56,7 +60,7 @@ public:
virtual
void
convert
(
const
GpuMat
&
src
,
GpuMat
&
dst
)
const
=
0
;
// for gpu::device::setTo funcs
virtual
void
setTo
(
cv
::
gpu
::
GpuMat
&
,
cv
::
Scalar
,
const
cv
::
gpu
::
GpuMat
&
,
CUstream_st
*
)
const
=
0
;
virtual
void
setTo
(
cv
::
gpu
::
GpuMat
&
,
cv
::
Scalar
,
const
cv
::
gpu
::
GpuMat
&
,
cudaStream_t
)
const
=
0
;
virtual
void
mallocPitch
(
void
**
devPtr
,
size_t
*
step
,
size_t
width
,
size_t
height
)
const
=
0
;
virtual
void
free
(
void
*
devPtr
)
const
=
0
;
...
...
@@ -96,8 +100,15 @@ public:
bool
hasEqualOrGreaterPtx
(
int
,
int
)
const
{
throw_nogpu
;
return
false
;
}
bool
hasEqualOrGreaterBin
(
int
,
int
)
const
{
throw_nogpu
;
return
false
;
}
void
printCudaDeviceInfo
(
int
)
const
{
throw_nogpu
;
}
void
printShortCudaDeviceInfo
(
int
)
const
{
throw_nogpu
;
}
void
printCudaDeviceInfo
(
int
)
const
{
printf
(
"The library is compiled without CUDA support
\n
"
);
}
void
printShortCudaDeviceInfo
(
int
)
const
{
printf
(
"The library is compiled without CUDA support
\n
"
);
}
};
class
EmptyFuncTable
:
public
GpuFuncTable
...
...
@@ -113,7 +124,7 @@ public:
void
convert
(
const
GpuMat
&
,
GpuMat
&
)
const
{
throw_nogpu
;
}
void
convert
(
const
GpuMat
&
,
GpuMat
&
,
double
,
double
,
cudaStream_t
stream
=
0
)
const
{
(
void
)
stream
;
throw_nogpu
;
}
virtual
void
setTo
(
cv
::
gpu
::
GpuMat
&
,
cv
::
Scalar
,
const
cv
::
gpu
::
GpuMat
&
,
CUstream_st
*
)
const
{
throw_nogpu
;
}
virtual
void
setTo
(
cv
::
gpu
::
GpuMat
&
,
cv
::
Scalar
,
const
cv
::
gpu
::
GpuMat
&
,
cudaStream_t
)
const
{
throw_nogpu
;
}
void
mallocPitch
(
void
**
,
size_t
*
,
size_t
,
size_t
)
const
{
throw_nogpu
;
}
void
free
(
void
*
)
const
{}
...
...
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