Program Listing for File openmp.hpp
↰ Return to documentation for file (include/pinocchio/utils/openmp.hpp
)
//
// Copyright (c) 2021 INRIA
//
#ifndef __pinocchio_utils_openmp_hpp__
#define __pinocchio_utils_openmp_hpp__
#include <cstdlib>
namespace pinocchio
{
inline int getOpenMPNumThreadsEnv()
{
int num_threads = 1;
if(const char* env_p = std::getenv("OMP_NUM_THREADS"))
num_threads = atoi(env_p);
return num_threads;
}
}
#endif // ifndef __pinocchio_utils_openmp_hpp__