Faster random implementation
This commit is contained in:
parent
321c677da2
commit
742ef283e4
7 changed files with 49 additions and 10 deletions
|
|
@ -1,11 +1,15 @@
|
|||
#include <x86intrin.h>
|
||||
#include "rtweekend.hpp"
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#define TIMED_BLOCK__(number, ...) timed_block timed_block_##Number(__COUNTER__, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__)
|
||||
#define TIMED_BLOCK_(number, ...) TIMED_BLOCK__(number, ##__VA_ARGS__)
|
||||
#define TIMED_BLOCK(...) TIMED_BLOCK_(__LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define TIMED_BLOCK(...)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
struct debug_record
|
||||
{
|
||||
uint64_t cycles;
|
||||
|
|
@ -17,6 +21,7 @@ struct debug_record
|
|||
|
||||
};
|
||||
|
||||
|
||||
extern debug_record debug_record_array[];
|
||||
|
||||
struct timed_block {
|
||||
|
|
@ -37,3 +42,4 @@ struct timed_block {
|
|||
record->cycles += __rdtsc();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue