diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2014-10-29 20:32:33 -0500 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2014-10-29 20:32:33 -0500 |
commit | 8a27889d505b07d91ecd03ad1cfeb818b9b440f7 (patch) | |
tree | 733e342e932f67aa56b9554b6d901fea129ad578 /counts.h | |
parent | 40a6ba5c0a5f544bed9c11dc30b751e05a435b1e (diff) |
Add instrumentation
Track the number of comparisons, swaps, and rotations performed in each
part of the sorting algorithm.
Diffstat (limited to 'counts.h')
-rw-r--r-- | counts.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/counts.h b/counts.h new file mode 100644 index 0000000..46e2e18 --- /dev/null +++ b/counts.h @@ -0,0 +1,23 @@ +#ifndef COUNTS_H +#define COUNTS_H + +enum { + CURRENT, + SORTNET, + LAST_OVERLAP, + MERGE, + MOVE_BUFFER, + DISTRIBUTE, + MAX_COUNTS +}; + +extern struct counts { + unsigned long compare, swap, rotate; +} counts[MAX_COUNTS]; + +void clear_all_counts(void); +void clear_accumulator(void); +void add_counts(struct counts*, struct counts*); +void print_counts(void); + +#endif |