How to check the version of OpenMP on Linux

前端 未结 6 1651
臣服心动
臣服心动 2020-12-13 08:53

I wonder how to check the version of OpenMP on a Linux remote machine?

I don\'t know where it is installed either.

6条回答
  •  既然无缘
    2020-12-13 09:49

    This is a bit safer version of an answer by user2023370 above. Ancient OpenMP versions are omitted for brevity:

    #include 
    #include 
    using namespace std;
    ...
    fmt::print("OpenMP v{}\n", map{{200805, "3.0"},{201107, "3.1"}, {201307, "4.0"}, {201511, "4.5"}, {201811, "5.0"}}[_OPENMP]);
    

    If a new version number or corrupted one is encountered, this statement will not throw exception as opposed to using at() function member.

    Version numbers are from https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md.

提交回复
热议问题