@@ -111,29 +111,29 @@ int main(int argc, char * argv[])
111
111
OMP_PARALLEL ()
112
112
{
113
113
OMP_FOR ()
114
- for (auto i=0 ;i<order; i++) {
114
+ for (int i=0 ;i<order; i++) {
115
115
PRAGMA_SIMD
116
- for (auto j=0 ;j<order;j++) {
116
+ for (int j=0 ;j<order;j++) {
117
117
A[i*order+j] = static_cast <double >(i*order+j);
118
118
B[i*order+j] = 0.0 ;
119
119
}
120
120
}
121
121
}
122
122
123
123
// DEVICE
124
- OMP_TARGET ( data map (tofrom: A[0 :order*order], B[0 :order*order]) map (from:trans_time) )
124
+ OMP_TARGET ( data map (tofrom: A[0 :order*order], B[0 :order*order]) )
125
125
{
126
- for (auto iter = 0 ; iter<=iterations; iter++) {
126
+ for (int iter = 0 ; iter<=iterations; iter++) {
127
127
128
128
if (iter==1 ) trans_time = omp_get_wtime ();
129
129
130
130
// transpose the matrix
131
131
if (tile_size < order) {
132
132
OMP_TARGET ( teams distribute parallel for simd collapse (2 ) )
133
- for (auto it=0 ; it<order; it+=tile_size) {
134
- for (auto jt=0 ; jt<order; jt+=tile_size) {
135
- for (auto i=it; i<std::min (order,it+tile_size); i++) {
136
- for (auto j=jt; j<std::min (order,jt+tile_size); j++) {
133
+ for (int it=0 ; it<order; it+=tile_size) {
134
+ for (int jt=0 ; jt<order; jt+=tile_size) {
135
+ for (int i=it; i<std::min (order,it+tile_size); i++) {
136
+ for (int j=jt; j<std::min (order,jt+tile_size); j++) {
137
137
B[i*order+j] += A[j*order+i];
138
138
A[j*order+i] += 1.0 ;
139
139
}
@@ -142,8 +142,8 @@ int main(int argc, char * argv[])
142
142
}
143
143
} else {
144
144
OMP_TARGET ( teams distribute parallel for simd collapse (2 ) schedule (static ,1 ) )
145
- for (auto i=0 ;i<order; i++) {
146
- for (auto j=0 ;j<order;j++) {
145
+ for (int i=0 ;i<order; i++) {
146
+ for (int j=0 ;j<order;j++) {
147
147
B[i*order+j] += A[j*order+i];
148
148
A[j*order+i] += 1.0 ;
149
149
}
@@ -160,8 +160,8 @@ int main(int argc, char * argv[])
160
160
const auto addit = (iterations+1 .) * (iterations/2 .);
161
161
auto abserr = 0.0 ;
162
162
OMP_PARALLEL_FOR_REDUCE ( +:abserr )
163
- for (auto j=0 ; j<order; j++) {
164
- for (auto i=0 ; i<order; i++) {
163
+ for (int j=0 ; j<order; j++) {
164
+ for (int i=0 ; i<order; i++) {
165
165
const int ij = i*order+j;
166
166
const int ji = j*order+i;
167
167
const double reference = static_cast <double >(ij)*(1 .+iterations)+addit;
0 commit comments