【发布时间】:2020-11-16 22:49:07
【问题描述】:
我只需要将reduction(max: ) 子句应用于Dts->t,但似乎没有任何效果,我尝试了reduction(max:Dts.t), reduction(max:Dts->t), reduction(max:Dts) and reduction(max:t)。
#pragma acc parallel loop collapse(3) reduction(max:t) present(Dts)
for (k = KBEG; k <= KEND; k++){
for (j = JBEG; j <= JEND; j++){
for (i = IBEG; i <= IEND; i++){
Dts->t = MAX(Dts->t, C_dt[k][j][i]);
}}}
我收到这些类型的错误:
PGC-S-0035-Syntax error: Recovery attempted by replacing '.' by ',' (update_stage.c: 450)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier present by accparallel (update_stage.c: 450)
PGC-S-0040-Illegal use of symbol, invDt_hyp (update_stage.c: 450)
PGC-S-0036-Syntax error: Recovery attempted by inserting <nl> before keyword for (update_stage.c: 451)
PGC-S-0978-The clause parallel is deprecated; use clause gang instead (update_stage.c: 451)
PGC-S-0374-Clause gang(value) not allowed in #pragma acc parallel loop (update_stage.c: 451)
Dts 是 Step 类型的变量。
typedef struct Step_{
double *cmax;
double t;
.
.
.
} Step;
我试图加速的循环位于主函数中调用的例程中。在 main 函数中,定义了 Dts 并在那里编写
#pragma acc enter data create(Dts)
#pragma acc enter data copyin(Dts.t[:1])
【问题讨论】:
标签: openacc