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
766d950f
Commit
766d950f
authored
Aug 26, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
used new device layer in math per element operations
parent
7628e57f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
264 deletions
+0
-264
math.cu
modules/cudaarithm/src/cuda/math.cu
+0
-0
element_operations.cpp
modules/cudaarithm/src/element_operations.cpp
+0
-264
No files found.
modules/cudaarithm/src/cuda/math.cu
View file @
766d950f
This diff is collapsed.
Click to expand it.
modules/cudaarithm/src/element_operations.cpp
View file @
766d950f
...
...
@@ -451,270 +451,6 @@ void cv::cuda::absdiff(InputArray src1, InputArray src2, OutputArray dst, Stream
arithm_op
(
src1
,
src2
,
dst
,
noArray
(),
1.0
,
-
1
,
stream
,
absDiffMat
,
absDiffScalar
);
}
//////////////////////////////////////////////////////////////////////////////
// abs
namespace
arithm
{
template
<
typename
T
>
void
absMat
(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
}
void
cv
::
cuda
::
abs
(
InputArray
_src
,
OutputArray
_dst
,
Stream
&
stream
)
{
using
namespace
arithm
;
typedef
void
(
*
func_t
)(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[]
=
{
absMat
<
unsigned
char
>
,
absMat
<
signed
char
>
,
absMat
<
unsigned
short
>
,
absMat
<
short
>
,
absMat
<
int
>
,
absMat
<
float
>
,
absMat
<
double
>
};
GpuMat
src
=
_src
.
getGpuMat
();
const
int
depth
=
src
.
depth
();
CV_Assert
(
depth
<=
CV_64F
);
CV_Assert
(
src
.
channels
()
==
1
);
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
funcs
[
depth
](
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
//////////////////////////////////////////////////////////////////////////////
// sqr
namespace
arithm
{
template
<
typename
T
>
void
sqrMat
(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
}
void
cv
::
cuda
::
sqr
(
InputArray
_src
,
OutputArray
_dst
,
Stream
&
stream
)
{
using
namespace
arithm
;
typedef
void
(
*
func_t
)(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[]
=
{
sqrMat
<
unsigned
char
>
,
sqrMat
<
signed
char
>
,
sqrMat
<
unsigned
short
>
,
sqrMat
<
short
>
,
sqrMat
<
int
>
,
sqrMat
<
float
>
,
sqrMat
<
double
>
};
GpuMat
src
=
_src
.
getGpuMat
();
const
int
depth
=
src
.
depth
();
CV_Assert
(
depth
<=
CV_64F
);
CV_Assert
(
src
.
channels
()
==
1
);
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
funcs
[
depth
](
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
//////////////////////////////////////////////////////////////////////////////
// sqrt
namespace
arithm
{
template
<
typename
T
>
void
sqrtMat
(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
}
void
cv
::
cuda
::
sqrt
(
InputArray
_src
,
OutputArray
_dst
,
Stream
&
stream
)
{
using
namespace
arithm
;
typedef
void
(
*
func_t
)(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[]
=
{
sqrtMat
<
unsigned
char
>
,
sqrtMat
<
signed
char
>
,
sqrtMat
<
unsigned
short
>
,
sqrtMat
<
short
>
,
sqrtMat
<
int
>
,
sqrtMat
<
float
>
,
sqrtMat
<
double
>
};
GpuMat
src
=
_src
.
getGpuMat
();
const
int
depth
=
src
.
depth
();
CV_Assert
(
depth
<=
CV_64F
);
CV_Assert
(
src
.
channels
()
==
1
);
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
funcs
[
depth
](
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
////////////////////////////////////////////////////////////////////////
// exp
namespace
arithm
{
template
<
typename
T
>
void
expMat
(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
}
void
cv
::
cuda
::
exp
(
InputArray
_src
,
OutputArray
_dst
,
Stream
&
stream
)
{
using
namespace
arithm
;
typedef
void
(
*
func_t
)(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[]
=
{
expMat
<
unsigned
char
>
,
expMat
<
signed
char
>
,
expMat
<
unsigned
short
>
,
expMat
<
short
>
,
expMat
<
int
>
,
expMat
<
float
>
,
expMat
<
double
>
};
GpuMat
src
=
_src
.
getGpuMat
();
const
int
depth
=
src
.
depth
();
CV_Assert
(
depth
<=
CV_64F
);
CV_Assert
(
src
.
channels
()
==
1
);
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
funcs
[
depth
](
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
////////////////////////////////////////////////////////////////////////
// log
namespace
arithm
{
template
<
typename
T
>
void
logMat
(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
}
void
cv
::
cuda
::
log
(
InputArray
_src
,
OutputArray
_dst
,
Stream
&
stream
)
{
using
namespace
arithm
;
typedef
void
(
*
func_t
)(
PtrStepSzb
src
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[]
=
{
logMat
<
unsigned
char
>
,
logMat
<
signed
char
>
,
logMat
<
unsigned
short
>
,
logMat
<
short
>
,
logMat
<
int
>
,
logMat
<
float
>
,
logMat
<
double
>
};
GpuMat
src
=
_src
.
getGpuMat
();
const
int
depth
=
src
.
depth
();
CV_Assert
(
depth
<=
CV_64F
);
CV_Assert
(
src
.
channels
()
==
1
);
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
funcs
[
depth
](
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
////////////////////////////////////////////////////////////////////////
// pow
namespace
arithm
{
template
<
typename
T
>
void
pow
(
PtrStepSzb
src
,
double
power
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
}
void
cv
::
cuda
::
pow
(
InputArray
_src
,
double
power
,
OutputArray
_dst
,
Stream
&
stream
)
{
typedef
void
(
*
func_t
)(
PtrStepSzb
src
,
double
power
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[]
=
{
arithm
::
pow
<
unsigned
char
>
,
arithm
::
pow
<
signed
char
>
,
arithm
::
pow
<
unsigned
short
>
,
arithm
::
pow
<
short
>
,
arithm
::
pow
<
int
>
,
arithm
::
pow
<
float
>
,
arithm
::
pow
<
double
>
};
GpuMat
src
=
_src
.
getGpuMat
();
const
int
depth
=
src
.
depth
();
const
int
cn
=
src
.
channels
();
CV_Assert
(
depth
<=
CV_64F
);
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
PtrStepSzb
src_
(
src
.
rows
,
src
.
cols
*
cn
,
src
.
data
,
src
.
step
);
PtrStepSzb
dst_
(
src
.
rows
,
src
.
cols
*
cn
,
dst
.
data
,
dst
.
step
);
funcs
[
depth
](
src_
,
power
,
dst_
,
StreamAccessor
::
getStream
(
stream
));
}
//////////////////////////////////////////////////////////////////////////////
// compare
...
...
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