Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › Games101 作业7 绕坑引路 (Windows) › Reply To: Games101 作业7 绕坑引路 (Windows)
关于openmp并行可以看这个文档
https://tildesites.bowdoin.edu/~ltoma/teaching/cs3225-GIS/fall17/Lectures/openmp.html
操作非常简单:
在你需要并行化的for前面,加上
#pragma omp parallel for
然后在cmake中加上
set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -O3 -fopenmp")
重新执行cmake ..
然后编译即可。
上面的-O3也可以提速。
This post has received 1 vote up.
- This reply was modified 2 years, 9 months ago by suicca.