搜尋此網誌

2011年7月25日 星期一

OpenMP conditional compilation

Conditional compilation is used to prevent unwanted results created from a non openmp compliant compiler .

Following is its format:

#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_thread_num() 0
#endif
//some code here
int TID = omp_get_thread_num();


references:
OpenMP Official Web sites
Using OpenMP: Portable Shared Memory Parallel Programming

沒有留言:

張貼留言