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
b803c243
Commit
b803c243
authored
Sep 15, 2010
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added nppSafeCall
parent
912f8ff3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
arithm.cpp
modules/gpu/src/arithm.cpp
+0
-0
safe_call.hpp
modules/gpu/src/cuda/safe_call.hpp
+10
-1
matrix_operations.cpp
modules/gpu/src/matrix_operations.cpp
+4
-4
No files found.
modules/gpu/src/arithm.cpp
View file @
b803c243
This diff is collapsed.
Click to expand it.
modules/gpu/src/cuda/safe_call.hpp
View file @
b803c243
...
...
@@ -44,11 +44,14 @@
#define __OPENCV_CUDA_SAFE_CALL_HPP__
#include "cuda_runtime_api.h"
#include <nppdefs.h>
#if defined(__GNUC__)
#define cudaSafeCall(expr) ___cudaSafeCall(expr, __FILE__, __LINE__, __func__);
#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
namespace
cv
...
...
@@ -62,6 +65,12 @@ namespace cv
if
(
cudaSuccess
!=
err
)
cv
::
gpu
::
error
(
cudaGetErrorString
(
err
),
file
,
line
,
func
);
}
static
inline
void
___nppSafeCall
(
NppStatus
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
=
""
)
{
if
(
err
<
0
)
cv
::
gpu
::
error
(
"NPP Error"
,
file
,
line
,
func
);
}
}
}
...
...
modules/gpu/src/matrix_operations.cpp
View file @
b803c243
...
...
@@ -171,7 +171,7 @@ GpuMat& GpuMat::setTo(const Scalar& s, const GpuMat& mask)
sz
.
width
=
cols
;
sz
.
height
=
rows
;
Npp8u
nVal
=
(
Npp8u
)
s
[
0
];
npp
iSet_8u_C1R
(
nVal
,
(
Npp8u
*
)
ptr
<
char
>
(),
step
,
sz
);
npp
SafeCall
(
nppiSet_8u_C1R
(
nVal
,
(
Npp8u
*
)
ptr
<
char
>
(),
step
,
sz
)
);
break
;
}
case
CV_8UC4
:
...
...
@@ -180,7 +180,7 @@ GpuMat& GpuMat::setTo(const Scalar& s, const GpuMat& mask)
sz
.
width
=
cols
;
sz
.
height
=
rows
;
Npp8u
nVal
[]
=
{(
Npp8u
)
s
[
0
],
(
Npp8u
)
s
[
1
],
(
Npp8u
)
s
[
2
],
(
Npp8u
)
s
[
3
]};
npp
iSet_8u_C4R
(
nVal
,
(
Npp8u
*
)
ptr
<
char
>
(),
step
,
sz
);
npp
SafeCall
(
nppiSet_8u_C4R
(
nVal
,
(
Npp8u
*
)
ptr
<
char
>
(),
step
,
sz
)
);
break
;
}
case
CV_32SC1
:
...
...
@@ -189,7 +189,7 @@ GpuMat& GpuMat::setTo(const Scalar& s, const GpuMat& mask)
sz
.
width
=
cols
;
sz
.
height
=
rows
;
Npp32s
nVal
=
(
Npp32s
)
s
[
0
];
npp
iSet_32s_C1R
(
nVal
,
(
Npp32s
*
)
ptr
<
char
>
(),
step
,
sz
);
npp
SafeCall
(
nppiSet_32s_C1R
(
nVal
,
(
Npp32s
*
)
ptr
<
char
>
(),
step
,
sz
)
);
break
;
}
case
CV_32FC1
:
...
...
@@ -198,7 +198,7 @@ GpuMat& GpuMat::setTo(const Scalar& s, const GpuMat& mask)
sz
.
width
=
cols
;
sz
.
height
=
rows
;
Npp32f
nVal
=
(
Npp32f
)
s
[
0
];
npp
iSet_32f_C1R
(
nVal
,
(
Npp32f
*
)
ptr
<
char
>
(),
step
,
sz
);
npp
SafeCall
(
nppiSet_32f_C1R
(
nVal
,
(
Npp32f
*
)
ptr
<
char
>
(),
step
,
sz
)
);
break
;
}
default
:
...
...
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