多核加速(OPENMP)测试

Author:DriverMonkey

Mail:[email protected]

Phone:18575593141

 

测试环境:

Linux version 4.15.0-33-generic

gcc version 5.4.0

Ubuntu 5.4.0-6ubuntu1~16.04.10

四核处理器

测试代码:

//how to compile --- g++ openmp.cpp -fopenmp

#include 

using namespace std;


float get_time()
{
    struct timespec ts;  
      
    clock_gettime(CLOCK_MONOTONIC, &ts);  

    float return_v = float(ts.tv_sec)  + float(ts.tv_nsec / (1e9));
    cout<<"get_time = "<

你可能感兴趣的:(Linux,Debug,linux,资料,linux,学习)