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
5669ee81
Commit
5669ee81
authored
Oct 04, 2017
by
Peter J. Stieber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace private.cuda.hpp with conditional include of cuda_fp16.h.
parent
2a253772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
saturate_cast.hpp
modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp
+5
-3
No files found.
modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp
View file @
5669ee81
...
...
@@ -47,7 +47,9 @@
#define OPENCV_CUDEV_UTIL_SATURATE_CAST_HPP
#include "../common.hpp"
#include "opencv2/core/private.cuda.hpp"
#if __CUDACC_VER_MAJOR__ >= 9
#include <cuda_fp16.h>
#endif
namespace
cv
{
namespace
cudev
{
...
...
@@ -275,7 +277,7 @@ template <typename T, typename D> __device__ __forceinline__ D cast_fp16(T v);
template
<>
__device__
__forceinline__
float
cast_fp16
<
short
,
float
>
(
short
v
)
{
#if __CUDACC_VER_MAJOR__
>= 9
#if __CUDACC_VER_MAJOR__ >= 9
return
float
(
*
(
__half
*
)
&
v
);
#else
return
__half2float
(
v
);
...
...
@@ -284,7 +286,7 @@ template <> __device__ __forceinline__ float cast_fp16<short, float>(short v)
template
<>
__device__
__forceinline__
short
cast_fp16
<
float
,
short
>
(
float
v
)
{
#if __CUDACC_VER_MAJOR__
>= 9
#if __CUDACC_VER_MAJOR__ >= 9
__half
h
(
v
);
return
*
(
short
*
)
&
v
;
#else
...
...
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