Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
'#pragma omp parallel' is currently not supported in a generic class or function
Remarks
For more information, see Generics and OpenMP.
This error is obsolete in Visual Studio 2022 and later versions.
Example
The following example generates C3054.
// C3054.cpp
// compile with: /openmp /clr /c
#include <omp.h>
ref struct MyBaseClass {
// Delete the following 7 lines to resolve.
generic <class ItemType>
void Test(ItemType i) { // C3054
#pragma omp parallel num_threads(4)
{
int i = omp_get_thread_num();
}
}
// OK
void Test2() {
#pragma omp parallel num_threads(4)
{
int i = omp_get_thread_num();
}
}
};