3 #include <gomp-constants.h>
5 #define N (32*32*32+17)
7 #pragma acc routine vector
8 void __attribute__ ((noinline
)) vector (int ary
[N
])
10 #pragma acc loop vector
11 for (unsigned ix
= 0; ix
< N
; ix
++)
13 if (acc_on_device (acc_device_not_host
))
17 g
= __builtin_goacc_parlevel_id (GOMP_DIM_GANG
);
18 w
= __builtin_goacc_parlevel_id (GOMP_DIM_WORKER
);
19 v
= __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR
);
20 ary
[ix
] = (g
<< 16) | (w
<< 8) | v
;
35 for (ix
= 0; ix
< N
;ix
++)
39 #pragma acc parallel vector_length(VL) \
42 ondev
= acc_on_device (acc_device_not_host
);
46 #ifdef ACC_DEVICE_TYPE_radeon
47 /* AMD GCN uses the autovectorizer for the vector dimension: the use
48 of a function call in vector-partitioned code in this test is not
49 currently supported. */
53 for (ix
= 0; ix
< N
; ix
++)
60 int v
= ix
% vectorsize
;
62 expected
= (g
<< 16) | (w
<< 8) | v
;
65 if (ary
[ix
] != expected
)
68 printf ("ary[%d]=%x expected %x\n", ix
, ary
[ix
], expected
);