Re: [問題] openmp for loop 多迴圈 parallel
※ 引述《manquentin (明天會更好)》之銘言:
: 開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
: Linus
↑這個是人名 XD
: 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
: 問題(Question):
: for(int i = 0; i<N; i++){
: for(int j = i+1; j<N; j++){
: for(int k = j+1; k<N; k++){
: for(int l = k+1; l<N; l++){
: //parallelize this code here
: }
: }
: }
: }
這樣
#pragma omp parallel
for(int i = 0; i<N; i++){
for(int j = i+1; j<N; j++){
for(int k = j+1; k<N; k++){
#pragma omp for schedule(xxx) private(xxx)
for(int l = k+1; l<N; l++){
//parallelize this code here
}
}
}
}
: 單層用簡單的#pragma omp parallel for就是以做到平行化,
: 想請教如何用openmp 進行多層for loop的平行化
: 感謝
: 餵入的資料(Input):
: 預期的正確結果(Expected Output):
: 錯誤結果(Wrong Output):
: 程式碼(Code):(請善用置底文網頁, 記得排版)
: 補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.48.126
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1403244555.A.E2E.html
推
06/22 23:31, , 1F
06/22 23:31, 1F
推
07/25 22:03, , 2F
07/25 22:03, 2F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):