File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 2828#include " cpu_features/cpuinfo_aarch64.h"
2929#elif defined(CPU_FEATURES_ARCH_PPC)
3030#include " cpu_features/cpuinfo_ppc.h"
31+ #elif defined(CPU_FEATURES_ARCH_RISCV)
32+ #include " cpu_features/cpuinfo_riscv.h"
3133#endif
3234
3335#include < cstdlib>
@@ -253,6 +255,9 @@ namespace edm {
253255#elif defined(CPU_FEATURES_ARCH_PPC)
254256 const auto strings{GetPPCPlatformStrings ()};
255257 model = strings.machine ;
258+ #elif defined(CPU_FEATURES_ARCH_RISCV)
259+ const auto info{GetRiscvInfo ()};
260+ model = fmt::format (" riscv64 {} {}" , info.vendor , info.uarch );
256261#endif
257262 return model;
258263 }
Original file line number Diff line number Diff line change @@ -76,6 +76,12 @@ namespace edm {
7676 __asm__ __volatile__ (" isb; mrs %0, cntvct_el0" : " =r" (ret));
7777 return ret;
7878 }
79+ #elif defined(__riscv) && __riscv_xlen == 64
80+ static __inline__ unsigned long long rdtsc (void ) {
81+ unsigned long long cycles;
82+ asm volatile (" rdcycle %0" : " =r" (cycles));
83+ return cycles;
84+ }
7985#else
8086#error The file FWCore/Utilities/interface/HRRealTime.h needs to be set up for your CPU type.
8187#endif
You can’t perform that action at this time.
0 commit comments