随笔分类 - OpenMP
摘要:// OpenMP4.cpp : 定义控制台应用程序的入口点。 // 临界区方法进行求和 #include "stdafx.h" #include #include #include #define NUM_THREADS 2 int _tmain(int argc, _TCHAR* argv[]) { clock_t t1, t2; omp_set_num_thre...
阅读全文
摘要:// OpenMP3.cpp : 定义控制台应用程序的入口点。 // reduction 子句方法进行求和 #include "stdafx.h" #include #include #include "time.h" #define NUM_THREADS 2 int _tmain(int argc, _TCHAR* argv[]) { clock_t t1 = clock(...
阅读全文
摘要:// OpenMP2.cpp : 定义控制台应用程序的入口点。 // for 指令方法进行求和 #include "stdafx.h" #include #include #include #include #define NUM_THREADS 2 int _tmain(int argc, _TCHAR * argv[]) { omp_set_num_threads(NU...
阅读全文
摘要:// OpenMP1.cpp : 定义控制台应用程序的入口点。 // 使用并行区域方法进行求和 #include "stdafx.h" #include #include #include #define NUM_THREADS 2 int _tmain(int argc, _TCHAR* argv[]) { omp_set_num_threads(NUM_THREADS)...
阅读全文