You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since not all compilers (or versions) support OpenMP, it would be useful to have a check that prevents crashes when attempting to use OpenMP with a compiler that doesn't support it.
For example, embed the OPENMP define in something like the following:
// Check if compiler is GNU:
#if defined(__GNUC__) || defined(__GNUG__)
// Check version >= 6.1, which has full OpenMP support:
#if (__GNUC__ > 6) || (__GNUC__ == 6 && (__GNUC_MINOR__ >= 1) )
#define OPENMP
#endif
#endif
This isn't strictly necessary, but it might save a headache if one forgets to verify compiler version.
The text was updated successfully, but these errors were encountered:
Alternatively, a warning could be added to alert the user.
// Check if compiler is GNU:
#if defined(__GNUC__) || defined(__GNUG__)
// Check version >= 6.1, which has full OpenMP support:
#if (__GNUC__ > 6) || (__GNUC__ == 6 && (__GNUC_MINOR__ >= 1) )
printf("Compiler version not compatible with OpenMP: expect this to crash!");
#endif
#endif
Since not all compilers (or versions) support OpenMP, it would be useful to have a check that prevents crashes when attempting to use OpenMP with a compiler that doesn't support it.
For example, embed the OPENMP define in something like the following:
This isn't strictly necessary, but it might save a headache if one forgets to verify compiler version.
The text was updated successfully, but these errors were encountered: