aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/usleep.h
blob: 669b41cee01adc9e3fdc26d698121756321429e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <unistd.h>

int
fallback_usleep (useconds_t d)
{
  /* This function serves as a replacement for usleep in
     this test case.  It does not even attempt to be functionally
     equivalent  - we just want some sort of delay. */
  int i;
  int N = d * 2000;
  for (i = 0; i < N; i++)
    asm volatile ("" : : : "memory");
  return 0;
}

#pragma omp declare variant (fallback_usleep) match(construct={target},device={arch(nvptx)})
#pragma omp declare variant (fallback_usleep) match(construct={target},device={arch(gcn)})
#pragma omp declare variant (usleep) match(user={condition(1)})
int
tgt_usleep (useconds_t d)
{
  return 0;
}

#pragma omp declare target to (fallback_usleep, tgt_usleep)