Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/goacc/classify-kernels-unparallelized.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Check offloaded function's attributes and classification for unparallelized | |
2 OpenACC kernels. */ | |
3 | |
4 /* { dg-additional-options "-O2" } | |
5 { dg-additional-options "-fdump-tree-ompexp" } | |
6 { dg-additional-options "-fdump-tree-parloops1-all" } | |
7 { dg-additional-options "-fdump-tree-oaccdevlow" } */ | |
8 | |
9 #define N 1024 | |
10 | |
11 extern unsigned int *__restrict a; | |
12 extern unsigned int *__restrict b; | |
13 extern unsigned int *__restrict c; | |
14 | |
15 /* An "extern"al mapping of loop iterations/array indices makes the loop | |
16 unparallelizable. */ | |
17 extern unsigned int f (unsigned int); | |
18 | |
19 void KERNELS () | |
20 { | |
21 #pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) | |
22 for (unsigned int i = 0; i < N; i++) | |
23 c[i] = a[f (i)] + b[f (i)]; | |
24 } | |
25 | |
26 /* Check the offloaded function's attributes. | |
27 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint\\)\\)" 1 "ompexp" } } */ | |
28 | |
29 /* Check that exactly one OpenACC kernels construct is analyzed, and that it | |
30 can't be parallelized. | |
31 { dg-final { scan-tree-dump-times "FAILED:" 1 "parloops1" } } | |
32 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } } | |
33 { dg-final { scan-tree-dump-not "SUCCESS: may be parallelized" "parloops1" } } */ | |
34 | |
35 /* Check the offloaded function's classification and compute dimensions (will | |
36 always be 1 x 1 x 1 for non-offloading compilation). | |
37 { dg-final { scan-tree-dump-times "(?n)Function is unparallelized OpenACC kernels offload" 1 "oaccdevlow" } } | |
38 { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccdevlow" } } | |
39 { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels, omp target entrypoint\\)\\)" 1 "oaccdevlow" } } */ |