reduction with OpenMP with SSE/AVX

▼魔方 西西 提交于 2019-11-29 02:33:36

I guess the answer to your question is No. I don't think there is a better way of doing reduction with more complicated operators in OpenMP.

Assuming that the array is 16 bit aligned, number of openmp threads is 4, one might expect the performance gain to be 12x - 16x by OpenMP + SIMD. In realistic, it might not produce enough performance gain because

  1. There is a overhead in creating the openmp threads.
  2. The code is doing 1 addition operation for 1 Load operation. Hence, the CPU isn't doing enough computation. So, it almost looks like the CPU spends most of the time in loading the data, kind of memory bandwidth bound.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!