我正在尝试优化这个功能:
bool interpolate(const Mat &im, float ofsx, float ofsy, float a11, float a12, float a21, float a22, Mat &res)
{
bool ret = false;
// input size (-1 for the safe bilinear interpolation)
const int width = im.cols-1;
const int height = im.rows-1;
// output size
const int halfWidth = res.cols >> 1;
const int halfHeight = res.rows >> 1;
float *out = res.ptr<float>(0);
const float *imptr = im.ptr<float>(0);
for (int j=-halfHeight; j<=halfHeight; ++j)
{
const float rx = ofsx …Run Code Online (Sandbox Code Playgroud) 我目前正在进行一些优化并比较DSP应用的矢量化可能性,这似乎是AVX512的理想选择,因为它们只是简单的不相关的阵列处理循环.但是在新的i9上,与AVX2相比,使用AVX512时没有任何合理的改进.有什么指针吗?有什么好结果吗?(顺便说一句.我试过MSVC/CLANG/ICL,没有明显的区别,很多时候AVX512代码实际上看起来比较慢)