# The Minor Influence of Vector Length on the Final Results

**URL:** https://bempp.discourse.group/t/the-minor-influence-of-vector-length-on-the-final-results/106
**Category:** Bempp
**Created:** [18 November 2021 02:56 UTC](https://bempp.discourse.group/t/the-minor-influence-of-vector-length-on-the-final-results/106 "2021-11-18T02:56:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![LCheng](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@LCheng](https://bempp.discourse.group/u/LCheng)
#### Post date: [18 November 2021 02:56 UTC](https://bempp.discourse.group/t/the-minor-influence-of-vector-length-on-the-final-results/106/1 "2021-11-18T02:56:29Z")

</div>

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](https://global.discourse-cdn.com/free1/uploads/bempp/original/1X/ad07cd92c4028ce60b3a25101de303c9d7957782.png)

The comparision is shown below: (origav4.csv - vector length = 4; orig.csv - vector length = 8; orignovec.csv - no vectorization)  
 ![image](https://global.discourse-cdn.com/free1/uploads/bempp/original/1X/351f33e75e64bc5fb078da466226ff3690fa54ec.png)

The matrix size is 258\*258, but the mismatched element number is 9516.  
 ![image](https://global.discourse-cdn.com/free1/uploads/bempp/original/1X/3b15cbb859e662da5b2144f47d5cb7b49958f27f.png)

Best wishes,  
Long

---

<div class="post-metadata">

### Author: ![timo](https://yyz2.discourse-cdn.com/free1/user_avatar/bempp.discourse.group/timo/32/7_2.png) [@timo](https://bempp.discourse.group/u/timo)
#### Post date: [19 November 2021 11:26 UTC](https://bempp.discourse.group/t/the-minor-influence-of-vector-length-on-the-final-results/106/2 "2021-11-19T11:26:29Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![LCheng](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@LCheng](https://bempp.discourse.group/u/LCheng)
#### Post date: [19 November 2021 11:53 UTC](https://bempp.discourse.group/t/the-minor-influence-of-vector-length-on-the-final-results/106/3 "2021-11-19T11:53:52Z")

</div>

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
