Xilinx / Vitis_Libraries

Vitis Libraries
https://docs.xilinx.com/r/en-US/Vitis_Libraries
Apache License 2.0
839 stars 340 forks source link

CFB76::calculatePaddedNumElements #189

Open laurent-onenano opened 8 months ago

laurent-onenano commented 8 months ago

It looks like this line is wrong and should be

numChunks = (numRequestedElements + NUM_ELEMENTS_PER_BUFFER_CHUNK - 1) / NUM_ELEMENTS_PER_BUFFER_CHUNK;

otherwise it simply adds 0 all the time and doesn't do what it's supposed to do.

https://github.com/Xilinx/Vitis_Libraries/blob/a60e1df95fa43e715cc9223f470587456463be8b/quantitative_finance/L3/src/models/cf_b76/src/xf_fintech_cf_b76.cpp#L373

laurent-onenano commented 8 months ago

Actually, it works if and only if NUM_ELEMENTS_PER_BUFFER_CHUNK = 1 otherwise fails in every other case.