You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/vmaware.hpp
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -375,6 +375,7 @@
375
375
#include<type_traits>
376
376
#include<stdexcept>
377
377
#include<numeric>
378
+
#include<atomic>
378
379
379
380
#if (WINDOWS)
380
381
#include<windows.h>
@@ -4698,6 +4699,7 @@ struct VM {
4698
4699
#if (MSVC)
4699
4700
// make regs volatile so writes cannot be optimized out, if this isn't added and the code is compiled in release mode, cycles would be around 40 even under Hyper-V
4700
4701
volatileint regs[4]{};
4702
+
4701
4703
// ensure the CPU pipeline is drained of previous loads before we start the clock
4702
4704
_mm_lfence();
4703
4705
@@ -4988,8 +4990,10 @@ struct VM {
4988
4990
// collect results
4989
4991
constu64 a = t1_start.load(std::memory_order_acquire);
4990
4992
constu64 b = t1_end.load(std::memory_order_acquire);
4991
-
constu64 c = t2_start.load(std::memory_order_acquire);
4992
-
constu64 d = t2_end.load(std::memory_order_acquire);
4993
+
#ifdef __VMAWARE_DEBUG__
4994
+
constu64 c = t2_start.load(std::memory_order_acquire);
4995
+
constu64 d = t2_end.load(std::memory_order_acquire);
0 commit comments