1 // RUN: %libomptarget-compileopt-run-and-check-generic
2 
3 // UNSUPPORTED: amdgcn-amd-amdhsa
4 // UNSUPPORTED: amdgcn-amd-amdhsa-oldDriver
5 // UNSUPPORTED: amdgcn-amd-amdhsa-LTO
6 
7 #include <omp.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 
11 #define N (1024 * 1024 * 256)
12 
main(int argc,char * argv[])13 int main(int argc, char *argv[]) {
14   int *data = (int *)malloc(N * sizeof(int));
15 #pragma omp target map(from: data[0:N])
16   {
17     double start = omp_get_wtime();
18     for (int i = 0; i < N; ++i)
19       data[i] = i;
20     double end = omp_get_wtime();
21     double duration = end - start;
22     printf("duration: %lfs\n", duration);
23   }
24   free(data);
25   return 0;
26 }
27 
28 // CHECK: duration: {{.+[1-9]+}}
29 
30