- Timestamp:
- 09/02/10 19:26:07 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/Translator.cpp
r391 r423 3052 3052 anImplementation << "\t Ytbeta[" << con->getIn()-1 << "]=YG" << con->getOut() << "_" << con->getOutModule() << "("; 3053 3053 else{ // ibad=='A': case gradients Alpha: backward. 3054 if(firstAxis==1 && con->getReli() && con->getI() || 3054 3055 /* Old first wrong version for adding atomic pragma on the backward 3056 if(firstAxis==1 && con->getReli() && con->getI() || 3055 3057 firstAxis==2 && con->getRelj() && con->getJ() || 3056 3058 firstAxis==3 && con->getRelk() && con->getK() ){ 3057 if(parallel){ 3058 anImplementation << "\t #pragma omp atomic\n"; 3059 totalAtomicOperations++; 3060 } 3061 } 3059 if(parallel){ 3060 anImplementation << "\t #pragma omp atomic\n"; 3061 totalAtomicOperations++; 3062 } 3063 } 3064 */ 3065 3066 if(parallel){ 3067 bool flagCon=true; 3068 for(Table<Connection>::iterator conDest=theConnectionTable.begin(); conDest != theConnectionTable.end() && flagCon; conDest++){ 3069 if(conDest->getOutModule() == con->getOutModule() && 3070 conDest->getRelt() == con->getRelt() && 3071 conDest->ist() == con->ist() && 3072 conDest->isT() == con->isT() && 3073 conDest->getT() == con->getT() && 3074 conDest->getOut() == con->getOut() 3075 ){ 3076 3077 if(firstAxis==1 && con->getReli() && con->getI()!=conDest->getI() || 3078 firstAxis==2 && con->getRelj() && con->getJ()!=conDest->getJ() || 3079 firstAxis==3 && con->getRelk() && con->getK()!=conDest->getK() ){ 3080 anImplementation << "\t #pragma omp atomic\n"; 3081 totalAtomicOperations++; 3082 flagCon=false; 3083 3084 // To see/debug 3085 /*cout << "ctin: " << con->getOutModule() << " ====> " << con->getInModule() << " " 3086 << "trovata ctin: " << conDest->getOutModule() << " ====> " << conDest->getInModule() 3087 << " " << con->getOut() << " " << conDest->getOut() << "-- " << con->getI() << " " << conDest->getI() 3088 << "-- " << con->getReli() << " " << conDest->getReli() << "-- " << con->ist() << " " << conDest->ist() 3089 << "-- " << con->getT() << " " << conDest->getT() << "-- " << con->getRelt() << " " << conDest->getRelt() << endl; 3090 */ 3091 } 3092 } 3093 } 3094 3095 } 3096 3062 3097 anImplementation << "\t YG" << con->getOut() << "_" << con->getOutModule() << "("; 3063 3098 }
Note: See TracChangeset
for help on using the changeset viewer.