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
157a98ed
Commit
157a98ed
authored
Mar 14, 2013
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored cuda error handling; remove optional dependancies in soft cascade training app
parent
a4766641
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
38 additions
and
156 deletions
+38
-156
CMakeLists.txt
apps/sft/CMakeLists.txt
+1
-1
check_docs2.py
doc/check_docs2.py
+1
-0
stream_accessor.hpp
modules/core/include/opencv2/core/stream_accessor.hpp
+4
-4
cudastream.cpp
modules/core/src/cudastream.cpp
+0
-27
gpumat.cpp
modules/core/src/gpumat.cpp
+0
-8
matrix_operations.cpp
modules/core/src/matrix_operations.cpp
+0
-27
opengl_interop.cpp
modules/core/src/opengl_interop.cpp
+0
-12
precomp.hpp
modules/core/src/precomp.hpp
+19
-0
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+3
-2
stream_accessor.hpp
modules/gpu/include/opencv2/gpu/stream_accessor.hpp
+0
-65
precomp.hpp
modules/gpu/src/precomp.hpp
+1
-1
icf-sc.cu
modules/softcascade/src/cuda/icf-sc.cu
+6
-6
peopledetect.cpp
samples/cpp/peopledetect.cpp
+3
-3
No files found.
apps/sft/CMakeLists.txt
View file @
157a98ed
set
(
name sft
)
set
(
the_target opencv_
${
name
}
)
set
(
OPENCV_
${
the_target
}
_DEPS opencv_core opencv_softcascade opencv_highgui opencv_imgproc opencv_ml
OPTIONAL opencv_gpu opencv_objdetect opencv_featurest2d
)
set
(
OPENCV_
${
the_target
}
_DEPS opencv_core opencv_softcascade opencv_highgui opencv_imgproc opencv_ml
)
ocv_check_dependencies
(
${
OPENCV_
${
the_target
}
_DEPS
}
)
if
(
NOT OCV_DEPENDENCIES_FOUND
)
...
...
doc/check_docs2.py
View file @
157a98ed
...
...
@@ -199,6 +199,7 @@ def process_module(module, path):
if
module
==
"gpu"
:
hdrlist
.
append
(
os
.
path
.
join
(
path
,
".."
,
"core"
,
"include"
,
"opencv2"
,
"core"
,
"cuda_devptrs.hpp"
))
hdrlist
.
append
(
os
.
path
.
join
(
path
,
".."
,
"core"
,
"include"
,
"opencv2"
,
"core"
,
"gpumat.hpp"
))
hdrlist
.
append
(
os
.
path
.
join
(
path
,
".."
,
"core"
,
"include"
,
"opencv2"
,
"core"
,
"stream_accessor.hpp"
))
decls
=
[]
for
hname
in
hdrlist
:
...
...
modules/core/include/opencv2/core/stream_accessor.hpp
View file @
157a98ed
...
...
@@ -40,8 +40,8 @@
//
//M*/
#ifndef __OPENCV_
GPU
_STREAM_ACCESSOR_HPP__
#define __OPENCV_
GPU
_STREAM_ACCESSOR_HPP__
#ifndef __OPENCV_
CUDA
_STREAM_ACCESSOR_HPP__
#define __OPENCV_
CUDA
_STREAM_ACCESSOR_HPP__
#include "opencv2/core/gpumat.hpp"
#include "cuda_runtime_api.h"
...
...
@@ -61,4 +61,4 @@ namespace cv
}
}
#endif
/* __OPENCV_GPU_STREAM_ACCESSOR_HPP__ */
\ No newline at end of file
#endif
/* __OPENCV_CUDA_STREAM_ACCESSOR_HPP__ */
\ No newline at end of file
modules/core/src/cudastream.cpp
View file @
157a98ed
...
...
@@ -74,33 +74,6 @@ void cv::gpu::Stream::release() { throw_nogpu(); }
#include "opencv2/core/stream_accessor.hpp"
namespace
{
#if defined(__GNUC__)
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
#define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__, __func__)
#else
/* defined(__CUDACC__) || defined(__MSVC__) */
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__)
#define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__)
#endif
inline
void
___cudaSafeCall
(
cudaError_t
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
cudaSuccess
!=
err
)
cv
::
gpu
::
error
(
cudaGetErrorString
(
err
),
file
,
line
,
func
);
}
inline
void
___nppSafeCall
(
int
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
err
<
0
)
{
std
::
ostringstream
msg
;
msg
<<
"NPP API Call Error: "
<<
err
;
cv
::
gpu
::
error
(
msg
.
str
().
c_str
(),
file
,
line
,
func
);
}
}
}
namespace
cv
{
namespace
gpu
{
void
copyWithMask
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
GpuMat
&
mask
,
cudaStream_t
stream
);
...
...
modules/core/src/gpumat.cpp
View file @
157a98ed
...
...
@@ -72,19 +72,11 @@ using namespace cv::gpu;
namespace
{
#if defined(__GNUC__)
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
#define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__, __func__)
#else
/* defined(__CUDACC__) || defined(__MSVC__) */
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__)
#define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__)
#endif
inline
void
___cudaSafeCall
(
cudaError_t
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
cudaSuccess
!=
err
)
cv
::
gpu
::
error
(
cudaGetErrorString
(
err
),
file
,
line
,
func
);
}
inline
void
___nppSafeCall
(
int
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
err
<
0
)
...
...
modules/core/src/matrix_operations.cpp
View file @
157a98ed
...
...
@@ -190,33 +190,6 @@ void cv::gpu::CudaMem::release() { CV_Error(CV_GpuNotSupported, "The library is
GpuMat
cv
::
gpu
::
CudaMem
::
createGpuMatHeader
()
const
{
CV_Error
(
CV_GpuNotSupported
,
"The library is compiled without CUDA support"
);
return
GpuMat
();
}
#else
/* !defined (HAVE_CUDA) */
#include <cuda_runtime_api.h>
namespace
{
#if defined(__GNUC__)
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
#define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__, __func__)
#else
/* defined(__CUDACC__) || defined(__MSVC__) */
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__)
#define nppSafeCall(expr) ___nppSafeCall(expr, __FILE__, __LINE__)
#endif
inline
void
___cudaSafeCall
(
cudaError_t
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
cudaSuccess
!=
err
)
cv
::
gpu
::
error
(
cudaGetErrorString
(
err
),
file
,
line
,
func
);
}
inline
void
___nppSafeCall
(
int
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
err
<
0
)
{
std
::
ostringstream
msg
;
msg
<<
"NPP API Call Error: "
<<
err
;
cv
::
gpu
::
error
(
msg
.
str
().
c_str
(),
file
,
line
,
func
);
}
}
}
void
cv
::
gpu
::
registerPageLocked
(
Mat
&
m
)
{
...
...
modules/core/src/opengl_interop.cpp
View file @
157a98ed
...
...
@@ -67,18 +67,6 @@ namespace
void
throw_nocuda
()
{
CV_Error
(
CV_GpuNotSupported
,
"The library is compiled without GPU support"
);
}
#else
void
throw_nocuda
()
{
CV_Error
(
CV_StsNotImplemented
,
"The called functionality is disabled for current build or platform"
);
}
#if defined(__GNUC__)
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
#else
/* defined(__CUDACC__) || defined(__MSVC__) */
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__)
#endif
void
___cudaSafeCall
(
cudaError_t
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
cudaSuccess
!=
err
)
cv
::
gpu
::
error
(
cudaGetErrorString
(
err
),
file
,
line
,
func
);
}
#endif
#endif
}
...
...
modules/core/src/precomp.hpp
View file @
157a98ed
...
...
@@ -66,6 +66,25 @@
#define GET_OPTIMIZED(func) (func)
#endif
#ifdef HAVE_CUDA
# include <cuda_runtime_api.h>
# include "opencv2/core/gpumat.hpp"
# if defined(__GNUC__)
# define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
# else
# define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__)
# endif
static
inline
void
___cudaSafeCall
(
cudaError_t
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
cudaSuccess
!=
err
)
cv
::
gpu
::
error
(
cudaGetErrorString
(
err
),
file
,
line
,
func
);
}
#else
# define cudaSafeCall(expr)
#endif
namespace
cv
{
...
...
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
157a98ed
...
...
@@ -7,11 +7,12 @@
// copy or use the software.
//
//
//
License Agreement
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -22,7 +23,7 @@
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other
GpuM
aterials provided with the distribution.
// and/or other
m
aterials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
...
...
modules/gpu/include/opencv2/gpu/stream_accessor.hpp
deleted
100644 → 0
View file @
a4766641
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other GpuMaterials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_GPU_STREAM_ACCESSOR_HPP__
#define __OPENCV_GPU_STREAM_ACCESSOR_HPP__
#include "opencv2/gpu.hpp"
#include "cuda_runtime_api.h"
namespace
cv
{
namespace
gpu
{
// This is only header file that depends on Cuda. All other headers are independent.
// So if you use OpenCV binaries you do noot need to install Cuda Toolkit.
// But of you wanna use GPU by yourself, may get cuda stream instance using the class below.
// In this case you have to install Cuda Toolkit.
struct
StreamAccessor
{
CV_EXPORTS
static
cudaStream_t
getStream
(
const
cv
::
gpu
::
Stream
&
stream
);
};
}
}
#endif
/* __OPENCV_GPU_STREAM_ACCESSOR_HPP__ */
\ No newline at end of file
modules/gpu/src/precomp.hpp
View file @
157a98ed
...
...
@@ -106,7 +106,7 @@
#endif
#include "internal_shared.hpp"
#include "opencv2/
gpu
/stream_accessor.hpp"
#include "opencv2/
core
/stream_accessor.hpp"
#include "nvidia/core/NCV.hpp"
#include "nvidia/NPP_staging/NPP_staging.hpp"
...
...
modules/softcascade/src/cuda/icf-sc.cu
View file @
157a98ed
...
...
@@ -44,18 +44,18 @@
#include <float.h>
#include <stdio.h>
namespace
{
namespace cv { namespace softcascade { namespace internal {
void error(const char *error_string, const char *file, const int line, const char *func);
}}}
#if defined(__GNUC__)
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)
#else /* defined(__CUDACC__) || defined(__MSVC__) */
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__)
#endif
inline void ___cudaSafeCall(cudaError_t err, const char *file, const int line, const char *func = "")
{
// if (cudaSuccess != err) cv::gpu::error(cudaGetErrorString(err), file, line, func);
}
static inline void ___cudaSafeCall(cudaError_t err, const char *file, const int line, const char *func = "")
{
if (cudaSuccess != err) cv::softcascade::internal::error(cudaGetErrorString(err), file, line, func);
}
#ifndef CV_PI
...
...
samples/cpp/peopledetect.cpp
View file @
157a98ed
#include
"opencv2/imgproc.hpp"
#include
"opencv2/objdetect.hpp"
#include
"opencv2/highgui.hpp"
#include
<opencv2/imgproc.hpp>
#include
<opencv2/objdetect.hpp>
#include
<opencv2/highgui.hpp>
#include <opencv2/softcascade.hpp>
#include <iostream>
...
...
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