view libgomp/testsuite/libgomp.oacc-c-c++-common/subr.h @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children
line wrap: on
line source


#if ACC_DEVICE_TYPE_nvidia

#pragma acc routine nohost
static int clock (void)
{
  int thetime;

  asm __volatile__ ("mov.u32 %0, %%clock;" : "=r"(thetime));

  return thetime;
}

#endif

void
delay (unsigned long *d_o, unsigned long delay)
{
  int start, ticks;

  start = clock ();

  ticks = 0;

  while (ticks < delay)
    ticks = clock () - start;

  return;
}

void
delay2 (unsigned long *d_o, unsigned long delay, unsigned long tid)
{
  int start, ticks;

  start = clock ();

  ticks = 0;

  while (ticks < delay)
    ticks = clock () - start;

  d_o[0] = tid;

  return;
}