質問

I want to name a critical section in openmp

I names it like this:

#pragma omp critical [RawImageFile]

and I am getting this error:

error C3005: '[' : unexpected token encountered on OpenMP 'critical' directive  

if I use it in this way:

#pragma omp critical RawImageFile

I am getting this error:

error C3005: 'RawImageFile' : unexpected token encountered on OpenMP 'critical' directive   

if I use it in this way:

#pragma omp critical "RawImageFile"

I am getting this error:

 error C3005: 'string' : unexpected token encountered on OpenMP 'critical' directive

What is the correct syntax to name a critical section in opnmp in visual studio 2012?

役に立ちましたか?

解決

You should be using round-brackets i.e. #pragma omp critical (RawImageFile) not square-brackets. (The square-brackets in the description in the OpenMP specification are part of the syntax description and mean "optional"; they're not tokens which should be included in your code).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top