pgcc显示“无效的加速器数据区域:不允许分支进入或退出区域”对于我放置我的acc pragma的行,但我不明白为什么。
我正在为循环使用的所有数组使用copy,copyin和create。
我错过了什么?谢谢!
#pragma acc data copy(graph->pagerank), copyin(graph->indegree, graph->outdegree), create(pagerankNew)
while (1) {
#pragma acc kernels
{
for (i = 0; i < n; ++i) {
double sum = 0;
for (k = 0; k < graph->indegree[i]; ++k) {
//int j = graph->inlinks[i][k];
int j = 0;
sum += (1.0 / graph->outdegree[j]) * graph->pagerank[j];
}
pagerankNew[i] = firstterm + damping * sum;
double diff = fabs(graph->pagerank[i] - pagerankNew[i]);
// if(iterations > 50) {
if (diff != 0.000000 && diff < epsilon) {
return iterations;
}
}
for (k = 0; k < n; ++k) {
graph->pagerank[k] = pagerankNew[k];
}
}
++iterations;
}