矩阵加法的自动向量化

问题描述

我正在尝试简单的矩阵加法代码来自动矢量化。

float A[100];
float A[100];
float C[100];

int n = 6;

  for (int i=0; i<n; i++)
    for (int j=0; j<n; j++)
        C[i*n+j] = A[i*n+j] + B[i*n+j];

在对上述代码使用 Rpass 分析标志后,我得到以下评论:

the cost-model indicates that vectorization is not beneficial [-Rpass-missed=loop-vectorize]

the cost-model indicates that interleaving is not beneficial [-Rpass-missed=loop-vectorize]

loop not vectorized: the optimizer was unable to perform the requested transformation; the 
transformation might be disabled or specified as part of an unsupported transformation ordering

我应该做哪些更改以使其矢量化?这些评论是什么意思?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...