mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-30 19:53:46 +00:00
49 lines
677 B
C
49 lines
677 B
C
|
int
|
||
|
main (int argc, char **argv)
|
||
|
{
|
||
|
#define N 2
|
||
|
int a[N], b[N];
|
||
|
int i;
|
||
|
|
||
|
for (i = 0; i < N; i++)
|
||
|
{
|
||
|
a[i] = 3;
|
||
|
b[i] = 0;
|
||
|
}
|
||
|
|
||
|
#pragma acc parallel copyin (a[0:N]) copyout (b[0:N])
|
||
|
{
|
||
|
int ii;
|
||
|
|
||
|
for (ii = 0; ii < N; ii++)
|
||
|
{
|
||
|
const int idx = ii;
|
||
|
int n = 1;
|
||
|
const int len = n;
|
||
|
|
||
|
#pragma acc cache (a[0:N])
|
||
|
|
||
|
#pragma acc cache (a[0:N], b[0:N])
|
||
|
|
||
|
#pragma acc cache (a[0])
|
||
|
|
||
|
#pragma acc cache (a[0], a[1], b[0:N])
|
||
|
|
||
|
#pragma acc cache (a[idx])
|
||
|
|
||
|
#pragma acc cache (a[idx:len])
|
||
|
|
||
|
b[ii] = a[ii];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
for (i = 0; i < N; i++)
|
||
|
{
|
||
|
if (a[i] != b[i])
|
||
|
__builtin_abort ();
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|