Dividing loop iterations among threads

后端 未结 8 593
广开言路
广开言路 2021-01-05 03:41

I recently wrote a small number-crunching program that basically loops over an N-dimensional grid and performs some calculation at each point.

for (int i1 =          


        
8条回答
  •  耶瑟儿~
    2021-01-05 04:37

    As I understand it, OpenMP was made just for what you are trying to do, although I have to admit I have not used it yet myself. Basically it seems to boil down to just including a header and adding a pragma clause.

    You could probably also use Intel's Thread Building Blocks Library.

提交回复
热议问题