mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-11 03:52:59 +00:00
46 lines
563 B
C
46 lines
563 B
C
/* Exercise zero-length sub-arrays. */
|
|
|
|
const int n = 10;
|
|
|
|
void
|
|
subzero_present (int *a, int n)
|
|
{
|
|
#pragma acc data present (a[0:n])
|
|
;
|
|
#pragma acc data pcopy (a[0:n])
|
|
;
|
|
#pragma acc data pcopyin (a[0:n])
|
|
;
|
|
#pragma acc data pcopyout (a[0:n])
|
|
;
|
|
|
|
}
|
|
|
|
void
|
|
subzero (int *a, int n)
|
|
{
|
|
#pragma acc data create (a[0:n])
|
|
;
|
|
#pragma acc data copy (a[0:n])
|
|
;
|
|
#pragma acc data copyin (a[0:n])
|
|
;
|
|
#pragma acc data copyout (a[0:n])
|
|
;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int a[n];
|
|
|
|
#pragma acc data copy (a[0:n])
|
|
{
|
|
subzero_present (a, 0);
|
|
}
|
|
|
|
subzero (a, 0);
|
|
|
|
return 0;
|
|
}
|