2016年3月22日

摘要: 对于+,-,*,&,|,&&,||等运算,可以使用OpenMP提供的reduction方法,下面以求和+为例,说明其使用方法: 这里reduction的意思是:CPU多线程执行for循环,每个线程保存ans的副本,循环结束后累加每个线程的ans并输出为ans。我的结果是ans=0.23288398, 阅读全文

posted @ 2016-03-22 14:02 morxio 阅读(400) 评论(0) 推荐(0) 编辑

摘要: 环境:Windows 10 + Visual Studio 2015 Community 第一步:新建win32 console project 第二步:新建cpp文件,填入类似hello world的代码: 第三步,打开工程属性->C/C++下Language页面,将Open MP Support 阅读全文

posted @ 2016-03-22 12:12 morxio 阅读(1818) 评论(0) 推荐(0) 编辑