Thursday, February 23, 2012

#pragma

OpenMP를 쓰려면 #pragma를 사용 해야 하는것을 볼수 있다
역시 SurfaceFlinger.cpp 에서 threadLoop를 보면 바로 펑션 위에
#if 0
#pragma mark -
#pragma mark Main Loop
#endif 라는 구문을 볼수 있다.

그럼
#pragma는 뭘까?

The `#pragma' directive is the method specified by the C standard for providing additional information to the compiler, beyond what is conveyed in the language itself. Three forms of this directive (commonly known as pragmas) are specified by the 1999 C standard. A C compiler is free to attach any meaning it likes to other pragmas.

요놈은 결국 컴파일링 할때 몇몇가지 정보를 주는것이다.
#pragma omap for << 여기서 부터 OpenMP for loop 이 있다! 고로 여기서 부터 뜨래드를 실행하라
뭐 이런식으로 컴파일러에게 정보를 주는것이다.

No comments:

Post a Comment