PR target/82855
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / subr.h
blob9db236c836292ef121d650bdca01187444717315
2 #if ACC_DEVICE_TYPE_nvidia
4 #pragma acc routine nohost
5 static int clock (void)
7 int thetime;
9 asm __volatile__ ("mov.u32 %0, %%clock;" : "=r"(thetime));
11 return thetime;
14 #endif
16 void
17 delay (unsigned long *d_o, unsigned long delay)
19 int start, ticks;
21 start = clock ();
23 ticks = 0;
25 while (ticks < delay)
26 ticks = clock () - start;
28 return;
31 void
32 delay2 (unsigned long *d_o, unsigned long delay, unsigned long tid)
34 int start, ticks;
36 start = clock ();
38 ticks = 0;
40 while (ticks < delay)
41 ticks = clock () - start;
43 d_o[0] = tid;
45 return;