查询openmp的版本

vim test.cpp

#include <unordered_map>
#include <cstdio>
#include <omp.h>

int main(int argc, char *argv[])
{
std::unordered_map<unsigned,std::string> map{
{200505,"2.5"},{200805,"3.0"},{201107,"3.1"},{201307,"4.0"},{201511,"4.5"}};
printf("We have OpenMP %s.\n", map.at(_OPENMP).c_str());
return 0;
}

g++ -std=c++11 -fopenmp test.cpp

./a.out

posted on 2022-11-11 13:23  无人知晓LLH  阅读(385)  评论(0编辑  收藏  举报

导航