mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-02 18:53:22 +00:00
26 lines
345 B
C
26 lines
345 B
C
/* Verify that acc declare accept VLA variables. */
|
|
|
|
#include <assert.h>
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int N = 1000;
|
|
int i, A[N];
|
|
#pragma acc declare copy(A)
|
|
|
|
for (i = 0; i < N; i++)
|
|
A[i] = -i;
|
|
|
|
#pragma acc kernels
|
|
for (i = 0; i < N; i++)
|
|
A[i] = i;
|
|
|
|
#pragma acc update host(A)
|
|
|
|
for (i = 0; i < N; i++)
|
|
assert (A[i] == i);
|
|
|
|
return 0;
|
|
}
|