在OpenMP中使用共享数组时出现时间减慢问题
#include "stdafx.h"
#include <time.h>
#include <windows.h>
#include "omp.h"
static long num_steps=100000000;//将区间[0,1]分成num_steps(N)份,即num_steps个小矩形
double step;
#define NUM_THREADS 2
int _tmain(int argc, _TCHAR* argv[])
{
int i;
clock_t t1
原创
2022-04-12 14:52:27 ·
506 阅读 ·
0 评论