The Minor Influence of Vector Length on the Final Results

Hi, Bempp team,

I am testing the vectorization acceleration for Bempp using OpenCL on ARM v8 CPU. The vector length of ARM V8 is 4, but I found that the assembled matrix with the vectorization mismatches with the non-vectorized version. The phenomenon indicates that the vectorization has a little influence on the computation accurary, although good news is that the deviation is really small (~e-17~-18), and it will not effact our simulation. But if it is a potential error, it will be more solid.

The test code is attached below: (The yellow one is non-vectorized version; the white code is the original Bempp version. )
image

The comparision is shown below: (origav4.csv - vector length = 4; orig.csv - vector length = 8; orignovec.csv - no vectorization)
image

The matrix size is 258*258, but the mismatched element number is 9516.
image

Best wishes,
Long

Hi, this is to be expected. The vectorized version executes operations in a slightly different order than the non-vectorized version. So you will get small differences in the result, which are typically in the order of machine precision.

Thanks for your reply, Prof. Betcke. I realized that it is the summation error, too. The magnitude is dependent on the element number in a summation group. That is interesting.

Best wishes,
Long