What is the fastest portable way to copy an array in C++

后端 未结 8 582
面向向阳花
面向向阳花 2020-12-30 02:11

This question has been bothering me for some time. The possibilities I am considering are

  1. memcpy
  2. std::copy
  3. cblas_dcopy

Does a

8条回答
  •  没有蜡笔的小新
    2020-12-30 02:58

    I've made a small benchmark (VS 2018 Preview, MKL 2017 Update 4) to compare memcpy and the sequential version of cblas_?copy and found them to be equally fast on float and double.

提交回复
热议问题