mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-11 19:49:32 +00:00
40 lines
381 B
C
40 lines
381 B
C
|
#include <stdlib.h>
|
||
|
#include <openacc.h>
|
||
|
|
||
|
float b;
|
||
|
#pragma acc declare create (b)
|
||
|
|
||
|
#pragma acc routine
|
||
|
int
|
||
|
func (int a)
|
||
|
{
|
||
|
b = a + 1;
|
||
|
|
||
|
return b;
|
||
|
}
|
||
|
|
||
|
int
|
||
|
main (int argc, char **argv)
|
||
|
{
|
||
|
float a;
|
||
|
|
||
|
a = 2.0;
|
||
|
|
||
|
#pragma acc parallel copy (a)
|
||
|
{
|
||
|
b = a;
|
||
|
a = 1.0;
|
||
|
a = a + b;
|
||
|
}
|
||
|
|
||
|
if (a != 3.0)
|
||
|
abort ();
|
||
|
|
||
|
a = func (a);
|
||
|
|
||
|
if (a != 4.0)
|
||
|
abort ();
|
||
|
|
||
|
return 0;
|
||
|
}
|