Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

use byte arrays to remove inexact floating point number literals #1079

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tkng
Copy link
Contributor

@tkng tkng commented Jun 4, 2020

What this patch does to fix the issue.

Conversion between floating point value ↔️ decimal string representation cause some small error.

In this pull request, I removed floating point number literals. Instead, parameters are represented as an array of unsigned char, then casted to floating point number by reinterpret_cast.

Link to any relevant issues or pull requests.

fix #1078

@tkng tkng requested a review from primenumber June 4, 2020 06:26
@blueoil-butler blueoil-butler bot added the CI: auto-run Run CI automatically label Jun 4, 2020
@tkng tkng added the CI: test-dlk Run dlk test once label Jun 4, 2020
@blueoil-butler blueoil-butler bot removed the CI: test-dlk Run dlk test once label Jun 4, 2020
@tkng tkng changed the title use byte arrays to remove floating point number literals use byte arrays to remove inexact floating point number literals Jun 5, 2020
@tkng tkng changed the title use byte arrays to remove inexact floating point number literals use byte arrays to remove inexact floating point number literals Jun 5, 2020
@tkng tkng added the WIP Work in progress label Jun 5, 2020
#elif defined USE_NEON || defined USE_AVX
static Base<{{ node.dtype.cpptype() }}>::type {{ node.name }}_raw[] = {
alignas(16) static unsigned char {{ node.name }}_raw[] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where from 16-byte align?

@CLAassistant
Copy link

CLAassistant commented Jun 12, 2020

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI: auto-run Run CI automatically WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid error comes from floating point literal decimal representation in code generation
3 participants