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
63280767
Commit
63280767
authored
Sep 29, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7360 from alalek:fix_aarch64_fp16
parents
2f6c37b8
a9ab629f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
cvdef.h
modules/core/include/opencv2/core/cvdef.h
+7
-1
convert.cpp
modules/core/src/convert.cpp
+3
-3
No files found.
modules/core/include/opencv2/core/cvdef.h
View file @
63280767
...
...
@@ -307,10 +307,16 @@ enum CpuFeatures {
#define CV_2PI 6.283185307179586476925286766559
#define CV_LOG2 0.69314718055994530941723212145818
#if defined (__ARM_FP16_FORMAT_IEEE)
# define CV_FP16_TYPE 1
#else
# define CV_FP16_TYPE 0
#endif
typedef
union
Cv16suf
{
short
i
;
#if
( defined (__arm__) || defined (__aarch64__) ) && !defined (__CUDACC__) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) )
#if
CV_FP16_TYPE
__fp16
h
;
#endif
struct
_fp16Format
...
...
modules/core/src/convert.cpp
View file @
63280767
...
...
@@ -4380,7 +4380,7 @@ struct Cvt_SIMD<float, int>
#endif
#if !
( ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) ) )
#if !
CV_FP16_TYPE
// const numbers for floating points format
const
unsigned
int
kShiftSignificand
=
13
;
const
unsigned
int
kMaskFp16Significand
=
0x3ff
;
...
...
@@ -4388,7 +4388,7 @@ const unsigned int kBiasFp16Exponent = 15;
const
unsigned
int
kBiasFp32Exponent
=
127
;
#endif
#if
( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) )
#if
CV_FP16_TYPE
static
float
convertFp16SW
(
short
fp16
)
{
// Fp16 -> Fp32
...
...
@@ -4450,7 +4450,7 @@ static float convertFp16SW(short fp16)
}
#endif
#if
( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR__ ) ) || ( 5 <= __GNUC__ ) ) )
#if
CV_FP16_TYPE
static
short
convertFp16SW
(
float
fp32
)
{
// Fp32 -> Fp16
...
...
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