TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Auto-parallelizer: #pragma loop

2 点作者 boas大约 10 年前
I just discovered that MSVC++ can automatically run each iteration of a loop in parallel in separate threads. Add "#pragma loop(hint_parallel(8))" and "#pragma loop(ivdep)" before the loop, and compile with the /Qpar option. This simple change sped up my cryoablation simulation code by 4x.

2 条评论

boas大约 10 年前
A lot of the radiology software that I write involves iterating over a 3D grid. The auto-parallelizer lets you easily process each 2D slice on a different processor core. My laptop has 2 cores x 2 hyperthreads per core = 4 virtual cores, so 4x speedup.
dalke大约 10 年前
You might also be interested in OpenMP, which does similar things for more compilers than MSVC++.
评论 #9383790 未加载