TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Auto-parallelizer: #pragma loop

2 pointsby boasabout 10 years ago
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 comments

boasabout 10 years ago
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.
dalkeabout 10 years ago
You might also be interested in OpenMP, which does similar things for more compilers than MSVC++.
评论 #9383790 未加载