Skip to content

Commit b95d31a

Browse files
committed
[OpenMP][Offloading] Enlarge the work size of wtime.c in case of any noise
1 parent 6690c64 commit b95d31a

File tree

1 file changed

+8
-3
lines changed
  • openmp/libomptarget/test/offloading

1 file changed

+8
-3
lines changed

openmp/libomptarget/test/offloading/wtime.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@
66

77
#include <omp.h>
88
#include <stdio.h>
9+
#include <stdlib.h>
10+
11+
#define N (1024 * 1024 * 256)
912

1013
int main(int argc, char *argv[]) {
11-
int data[1024];
12-
#pragma omp target
14+
int *data = (int *)malloc(N * sizeof(int));
15+
#pragma omp target map(from: data[0:N])
1316
{
1417
double start = omp_get_wtime();
15-
for (int i = 0; i < 1024; ++i)
18+
for (int i = 0; i < N; ++i)
1619
data[i] = i;
1720
double end = omp_get_wtime();
1821
double duration = end - start;
1922
printf("duration: %lfs\n", duration);
2023
}
24+
free(data);
2125
return 0;
2226
}
2327

2428
// CHECK: duration: {{.+[1-9]+}}
29+

0 commit comments

Comments
 (0)