111
|
1 /* Check offloaded function's attributes and classification for OpenACC
|
|
2 parallel. */
|
|
3
|
|
4 /* { dg-additional-options "-O2" }
|
|
5 { dg-additional-options "-fdump-tree-ompexp" }
|
|
6 { dg-additional-options "-fdump-tree-oaccdevlow" } */
|
|
7
|
|
8 #define N 1024
|
|
9
|
|
10 extern unsigned int *__restrict a;
|
|
11 extern unsigned int *__restrict b;
|
|
12 extern unsigned int *__restrict c;
|
|
13
|
|
14 void PARALLEL ()
|
|
15 {
|
|
16 #pragma acc parallel loop copyin (a[0:N], b[0:N]) copyout (c[0:N])
|
|
17 for (unsigned int i = 0; i < N; i++)
|
|
18 c[i] = a[i] + b[i];
|
|
19 }
|
|
20
|
|
21 /* Check the offloaded function's attributes.
|
|
22 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(omp target entrypoint\\)\\)" 1 "ompexp" } } */
|
|
23
|
|
24 /* Check the offloaded function's classification and compute dimensions (will
|
|
25 always be 1 x 1 x 1 for non-offloading compilation).
|
|
26 { dg-final { scan-tree-dump-times "(?n)Function is OpenACC parallel offload" 1 "oaccdevlow" } }
|
|
27 { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccdevlow" } }
|
|
28 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), omp target entrypoint\\)\\)" 1 "oaccdevlow" } } */
|