cuda-kat
CUDA kernel author's tools
Macros | Typedefs | Enumerations | Functions
time.cuh File Reference

CUDA device-side functions having to do with timing and the hardware clock. More...

#include <type_traits>

Typedefs

using kat::clock_value_t = long long int
 
template<sleep_resolution Resolution>
using kat::sleep_unit_t = typename detail::sleep_unit< Resolution >::type
 

Enumerations

enum  sleep_resolution {
  clock_cycles,
  nanoseconds
}
 

Functions

template<sleep_resolution Resolution = sleep_resolution::clock_cycles>
KAT_DEV void kat::sleep (sleep_unit_t< Resolution > num_cycles)=delete
 Have the calling warp busy-sleep for (at least) a certain number of clock cycles. More...
 
template<>
KAT_DEV void kat::sleep< sleep_resolution::clock_cycles > (sleep_unit_t< sleep_resolution::clock_cycles > num_cycles)
 

Detailed Description

CUDA device-side functions having to do with timing and the hardware clock.

Function Documentation

§ sleep()

template<sleep_resolution Resolution = sleep_resolution::clock_cycles>
KAT_DEV void kat::sleep ( sleep_unit_t< Resolution >  num_cycles)
delete

Have the calling warp busy-sleep for (at least) a certain number of clock cycles.

Note
In 2017, a typical GPU clock cycle is around 1 ns (i.e. 1 GHz frequency).