25#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
26 #define SHAMROCK_INTRISICS_GET_DEVICE_CLOCK_AVAILABLE
35 #if __has_builtin(__nvvm_read_ptx_sreg_globaltimer)
36 return __nvvm_read_ptx_sreg_globaltimer();
39 asm(
"mov.u64 %0, %%globaltimer;" :
"=l"(clock));
45#elif defined(_IS_ACPP_SSCP)
46 #define SHAMROCK_INTRISICS_GET_DEVICE_CLOCK_AVAILABLE
52 namespace jit = sycl::AdaptiveCpp_jit;
54 __acpp_if_target_sscp(
56 jit::reflect<jit::reflection_query::compiler_backend>()
57 == jit::compiler_backend::host,
59 ret_val = std::chrono::high_resolution_clock::now().time_since_epoch().count();
62 #if __has_builtin(__nvvm_read_ptx_sreg_globaltimer)
63 __acpp_if_target_sscp(
65 jit::reflect<jit::reflection_query::target_vendor_id>() == jit::vendor_id::nvidia,
67 ret_val = __nvvm_read_ptx_sreg_globaltimer();
71 __acpp_if_target_sscp(
73 jit::reflect<jit::reflection_query::target_vendor_id>() == jit::vendor_id::nvidia,
76 asm(
"mov.u64 %0, %%globaltimer;" :
"=l"(clock));
85#elif defined(_IS_ACPP_SMCP_HOST)
86 #define SHAMROCK_INTRISICS_GET_DEVICE_CLOCK_AVAILABLE
90 return std::chrono::high_resolution_clock::now().time_since_epoch().count();
std::uint64_t u64
64 bit unsigned integer
This file implement the GPU core timeline tool from A. Richermoz, F. Neyret 2024.
This file implement the GPU core timeline tool from A. Richermoz, F. Neyret 2024.
namespace for backends this one is named only sham since shambackends is too long to write
u64 get_device_clock()
Return the number of clock cycles elapsed since an arbitrary starting point on the device.