Skip to content

Commit a4299f0

Browse files
Jeff Hammondjeffhammond
Jeff Hammond
authored andcommitted
do not map timers
1 parent 443540a commit a4299f0

6 files changed

+17
-20
lines changed

Cxx11/nstream-openmp-target.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ int main(int argc, char * argv[])
129129
}
130130

131131
// DEVICE
132-
OMP_TARGET( data map(tofrom: A[0:length], B[0:length], C[0:length]) map(from:nstream_time) )
132+
OMP_TARGET( data map(tofrom: A[0:length], B[0:length], C[0:length]) )
133133
{
134134
for (auto iter = 0; iter<=iterations; iter++) {
135135

Cxx11/transpose-openmp-target.cc

+12-12
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,29 @@ int main(int argc, char * argv[])
111111
OMP_PARALLEL()
112112
{
113113
OMP_FOR()
114-
for (auto i=0;i<order; i++) {
114+
for (int i=0;i<order; i++) {
115115
PRAGMA_SIMD
116-
for (auto j=0;j<order;j++) {
116+
for (int j=0;j<order;j++) {
117117
A[i*order+j] = static_cast<double>(i*order+j);
118118
B[i*order+j] = 0.0;
119119
}
120120
}
121121
}
122122

123123
// 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]) )
125125
{
126-
for (auto iter = 0; iter<=iterations; iter++) {
126+
for (int iter = 0; iter<=iterations; iter++) {
127127

128128
if (iter==1) trans_time = omp_get_wtime();
129129

130130
// transpose the matrix
131131
if (tile_size < order) {
132132
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++) {
137137
B[i*order+j] += A[j*order+i];
138138
A[j*order+i] += 1.0;
139139
}
@@ -142,8 +142,8 @@ int main(int argc, char * argv[])
142142
}
143143
} else {
144144
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++) {
147147
B[i*order+j] += A[j*order+i];
148148
A[j*order+i] += 1.0;
149149
}
@@ -160,8 +160,8 @@ int main(int argc, char * argv[])
160160
const auto addit = (iterations+1.) * (iterations/2.);
161161
auto abserr = 0.0;
162162
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++) {
165165
const int ij = i*order+j;
166166
const int ji = j*order+i;
167167
const double reference = static_cast<double>(ij)*(1.+iterations)+addit;

FORTRAN/dgemm-openmp-target.f90

+1-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ program main
149149
enddo
150150
!$omp end parallel do
151151

152-
!$omp target data map(to: A,B) map(tofrom: C) map(from:dgemm_time) &
153-
!$omp& map(to:iterations,order)
152+
!$omp target data map(to: A,B) map(tofrom: C) map(to:order)
154153

155154
t0 = 0
156155

FORTRAN/nstream-openmp-target.f90

+1-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ program main
163163
enddo
164164
!$omp end parallel do simd
165165

166-
!$omp target data map(tofrom: A) map(to: B,C) map(from:nstream_time) &
167-
!$omp& map(to:iterations,length)
166+
!$omp target data map(tofrom: A) map(to: B,C) map(to:length)
168167

169168
do k=0,iterations
170169

FORTRAN/stencil-openmp-target.f90

+1-2
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,7 @@ program main
320320
#endif
321321
!$omp end parallel
322322

323-
!$omp target data map(to:W, A) map(tofrom: B) map(from:stencil_time) &
324-
!$omp& map(to:iterations,n)
323+
!$omp target data map(to:W, A) map(tofrom: B) map(to:n)
325324

326325
t0 = 0
327326

FORTRAN/transpose-openmp-target.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ program main
143143
enddo
144144
!$omp end parallel do simd
145145

146-
!$omp target data map(to: A) map(tofrom: B) map(from:trans_time)
146+
!$omp target data map(to: A) map(tofrom: B)
147147

148148
t0 = 0
149149

0 commit comments

Comments
 (0)