Changeset 0092853
- Timestamp:
- May 26, 2020, 2:55:02 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 47a541d
- Parents:
- 8e1b1bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/code/relaxed_list.hpp
r8e1b1bb r0092853 1 1 #pragma once 2 2 3 enum VARIANTS { 4 VANILLA, 5 SNZI, 6 BITMASK, 7 DISCOVER 8 }; 3 #define MACRO_XSTR(s) MACRO_STR(s) 4 #define MACRO_STR(s) #s 5 6 #define VANILLA 0 7 #define SNZI 1 8 #define BITMASK 2 9 #define DISCOVER 3 9 10 10 11 #ifndef VARIANT … … 24 25 #include "utils.hpp" 25 26 #include "snzi.hpp" 26 27 #define MACRO_XSTR(s) MACRO_STR(s)28 #define MACRO_STR(s) #s29 27 30 28 using namespace std; … … 69 67 public: 70 68 static const char * name() { 71 return MACRO_XSTR(VARIANT); 69 const char * names[] = { 70 "VANILLA", 71 "SNZI", 72 "BITMASK", 73 "DISCOVER" 74 }; 75 return names[VARIANT]; 72 76 } 73 77 … … 521 525 void stats_print_local(std::ostream & os ) { 522 526 std::cout << "----- Relaxed List Stats -----" << std::endl; 523 {524 ssize_t diff = 0;525 size_t num = 0;526 ssize_t max = 0;527 528 for(size_t i = 0; i < numLists; i++) {529 const auto & list = lists[i];530 diff+= list.s.diff;531 num ++;532 max = std::abs(max) > std::abs(list.s.diff) ? max : list.s.diff;533 os << "Local Q ops : " << (list.s.push + list.s.pop) << "(" << list.s.push << "i, " << list.s.pop << "o)\n";534 }535 536 os << "Difference : " << ssize_t(double(diff) / num ) << " avg\t" << max << "max" << std::endl;537 }527 // { 528 // ssize_t diff = 0; 529 // size_t num = 0; 530 // ssize_t max = 0; 531 532 // for(size_t i = 0; i < numLists; i++) { 533 // const auto & list = lists[i]; 534 // diff+= list.s.diff; 535 // num ++; 536 // max = std::abs(max) > std::abs(list.s.diff) ? max : list.s.diff; 537 // os << "Local Q ops : " << (list.s.push + list.s.pop) << "(" << list.s.push << "i, " << list.s.pop << "o)\n"; 538 // } 539 540 // os << "Difference : " << ssize_t(double(diff) / num ) << " avg\t" << max << "max" << std::endl; 541 // } 538 542 539 543 const auto & global = global_stats;
Note: See TracChangeset
for help on using the changeset viewer.