Application Acceleration With FPGAs
Programmable Acceleration Cards (PACs), DCP, FPGA AI Suite, Software Stack, and Reference Designs
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
504 Discussions

shift register cause computational results error????

zjinf
New Contributor I
1,453 Views

Hi inteler/alteraer

i refer p130~131 on https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl-best-practices-guide.pdf write my code.

i found shift register will cause computational results error (1.0e-3f), that is integer parts and the first 2 bit of decimal also ok, no problem, but from the 3 bit , it will difference from PC ' results(for example : pc' results : 100.11234[FPGA without shift register also 100.11234], and fpga with shift register is 100.11341)

if i don't use shift register, the fpga's results is OK!

how can i fix the computational error!

 

thanks for your help!

 

 

0 Kudos
1 Solution
zjinf
New Contributor I
1,147 Views

hi HRZ

Thanks for your explanation ! it seems like what you say above

View solution in original post

0 Kudos
2 Replies
HRZ
Valued Contributor III
1,147 Views

There is no "computational error" to fix. You are changing the order of the floating-point computations using that optimization, which will result in minor differences in the output due to rounding differences. Floating-point computations are not associative. If your application does not allow re-ordering of floating-point operations, you should not use that optimization. If you are using Arria 10/Stratix 10, that optimization is not required for single-precision floating-point reduction and you can use single-cycle accumulation instead. Check Intel's guides for more info.

0 Kudos
zjinf
New Contributor I
1,148 Views

hi HRZ

Thanks for your explanation ! it seems like what you say above

0 Kudos
Reply