Skip to content

Instantly share code, notes, and snippets.

@Muhammad-Yunus
Created September 8, 2021 15:26
Show Gist options
  • Save Muhammad-Yunus/7f8c621b4d0bce1328f059b19467bdf1 to your computer and use it in GitHub Desktop.
Save Muhammad-Yunus/7f8c621b4d0bce1328f059b19467bdf1 to your computer and use it in GitHub Desktop.
Check OpenMP Installed on Linux Systems,
// SOURCE : https://stackoverflow.com/questions/1304363/how-to-check-the-version-of-openmp-on-linux
// BUILD : g++ -std=c++11 -fopenmp openmp_test.cpp -o openmp_test
// RUN : ./openmp_test
#include <unordered_map>
#include <iostream>
#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"},{201811,"5.0"},{202011,"5.1"}};
std::cout << "We have OpenMP " << map.at(_OPENMP) << ".\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment