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
39ebca5d
Commit
39ebca5d
authored
Aug 08, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7047 from tomoaki0705:brushUpFp16Cuda
parents
ad974de1
2db2d137
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
cuda.hpp
modules/core/include/opencv2/core/cuda.hpp
+8
-1
gpu_mat.cu
modules/core/src/cuda/gpu_mat.cu
+1
-1
test_cvt.cu
modules/cudev/test/test_cvt.cu
+6
-6
No files found.
modules/core/include/opencv2/core/cuda.hpp
View file @
39ebca5d
...
...
@@ -855,7 +855,14 @@ private:
CV_EXPORTS
void
printCudaDeviceInfo
(
int
device
);
CV_EXPORTS
void
printShortCudaDeviceInfo
(
int
device
);
CV_EXPORTS
void
convertFp16Cuda
(
InputArray
_src
,
OutputArray
_dst
,
Stream
&
stream
=
Stream
::
Null
());
/** @brief Converts an array to half precision floating number.
@param _src input array.
@param _dst output array.
@param stream Stream for the asynchronous version.
@sa convertFp16
*/
CV_EXPORTS
void
convertFp16
(
InputArray
_src
,
OutputArray
_dst
,
Stream
&
stream
=
Stream
::
Null
());
//! @} cudacore_init
...
...
modules/core/src/cuda/gpu_mat.cu
View file @
39ebca5d
...
...
@@ -594,7 +594,7 @@ void cv::cuda::GpuMat::convertTo(OutputArray _dst, int rtype, double alpha, doub
funcs[sdepth][ddepth](reshape(1), dst.reshape(1), alpha, beta, stream);
}
void cv::cuda::convertFp16
Cuda
(InputArray _src, OutputArray _dst, Stream& stream)
void cv::cuda::convertFp16(InputArray _src, OutputArray _dst, Stream& stream)
{
GpuMat src = _src.getGpuMat();
int ddepth = 0;
...
...
modules/cudev/test/test_cvt.cu
View file @
39ebca5d
...
...
@@ -101,11 +101,11 @@ public:
GpuMat g_dst;
// Fp32 -> Fp16
c
onvertFp16Cuda
(g_src, g_dst);
c
onvertFp16Cuda(g_dst.clone(), g_
dst);
c
uda::convertFp16
(g_src, g_dst);
c
v::convertFp16(src,
dst);
// Fp16 -> Fp32
c
onvertFp16(src,
dst);
convertFp16(dst, ref);
c
uda::convertFp16(g_dst.clone(), g_
dst);
c
v::c
onvertFp16(dst, ref);
g_dst.download(dst);
EXPECT_MAT_NEAR(dst, ref, 0.0);
...
...
@@ -127,8 +127,8 @@ public:
GpuMat g_dst;
// Fp32 -> Fp16
c
onvertFp16Cuda
(g_src, g_dst);
convertFp16(src, ref);
c
uda::convertFp16
(g_src, g_dst);
c
v::c
onvertFp16(src, ref);
g_dst.download(dst);
EXPECT_MAT_NEAR(dst, ref, 0.0);
...
...
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