Re: [問題] openmp for loop 多迴圈 parallel

看板C_and_CPP作者 (LYSin8)時間10年前 (2014/06/20 14:09), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《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
文章代碼(AID): #1Jez0Buk (C_and_CPP)
文章代碼(AID): #1Jez0Buk (C_and_CPP)