forked from OSchip/llvm-project
[OpenMP][Offloading] Enlarge the work size of `wtime.c` in case of any noise
This commit is contained in:
parent
6690c64639
commit
b95d31a849
|
@ -6,19 +6,24 @@
|
|||
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define N (1024 * 1024 * 256)
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int data[1024];
|
||||
#pragma omp target
|
||||
int *data = (int *)malloc(N * sizeof(int));
|
||||
#pragma omp target map(from: data[0:N])
|
||||
{
|
||||
double start = omp_get_wtime();
|
||||
for (int i = 0; i < 1024; ++i)
|
||||
for (int i = 0; i < N; ++i)
|
||||
data[i] = i;
|
||||
double end = omp_get_wtime();
|
||||
double duration = end - start;
|
||||
printf("duration: %lfs\n", duration);
|
||||
}
|
||||
free(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// CHECK: duration: {{.+[1-9]+}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue