編譯器錯誤 C3042
'copyprivate' 和 'nowait' 子句不可以同時出現在 OpenMP「指示詞」指示詞中
在指定的指示詞上, copyprivate 與 nowait 子句互斥。 若要修正這個錯誤,請移除 copyprivate
及/或 nowait
子句。
下列範例會產生 C3042:
// C3042.cpp
// compile with: /openmp /c
#include <stdio.h>
#include "omp.h"
double d;
int main() {
#pragma omp parallel private(d)
{
#pragma omp single copyprivate(d) nowait // C3042
{
}
}
}