Cygwin: access: Fix X_OK behaviour for backup operators and admins
[newlib-cygwin.git] / newlib / libc / machine / nvptx / clock.c
blob1ad69f1ea8ea60043ac3a79e715f7001c72a7901
1 /* clock.c
2 * Support file for nvptx in newlib.
3 */
4 #include <time.h>
6 clock_t
7 clock ()
9 unsigned long long now;
10 #if __PTX_SM__ >= 310
11 asm volatile("mov.u64 %0, %%globaltimer;" : "=r"(now));
12 return now/((1000000000ull)/CLOCKS_PER_SEC);
13 #else
14 asm volatile("mov.u64 %0, %%clock64;" : "=r"(now));
15 // Assume a GPU base clock frequency of 1250MHz.
16 return now/((1250000000ull)/CLOCKS_PER_SEC);
17 #endif