- Timestamp:
- Dec 16, 2020, 11:57:02 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 2b4daf2
- Parents:
- ccb8c8a (diff), 54eb1bb3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/code/readQ_example/proto-gui/main.cpp
rccb8c8a r42f6e07 11 11 #include <getopt.h> 12 12 using thrdlib::thread_t; 13 14 15 extern __attribute__((aligned(128))) thread_local struct {16 void * volatile this_thread;17 void * volatile this_processor;18 void * volatile this_stats;19 20 struct {21 volatile unsigned short disable_count;22 volatile bool enabled;23 volatile bool in_progress;24 } preemption_state;25 26 #if defined(__SIZEOF_INT128__)27 __uint128_t rand_seed;28 #else29 uint64_t rand_seed;30 #endif31 struct {32 uint64_t fwd_seed;33 uint64_t bck_seed;34 } ready_rng;35 } kernelTLS __attribute__ ((tls_model ( "initial-exec" )));36 13 37 14 //-------------------- … … 148 125 } 149 126 127 typedef uint64_t __wyhash64_state_t; 128 static inline uint64_t __wyhash64( __wyhash64_state_t & state ) { 129 state += 0x60bee2bee120fc15; 130 __uint128_t tmp; 131 tmp = (__uint128_t) state * 0xa3b195354a39b70d; 132 uint64_t m1 = (tmp >> 64) ^ tmp; 133 tmp = (__uint128_t)m1 * 0x1b03738712fad5c9; 134 uint64_t m2 = (tmp >> 64) ^ tmp; 135 return m2; 136 } 137 150 138 void Simulator( thread_t self ) { 151 139 for(unsigned i = 0; i < nproduce; i++) { … … 156 144 } 157 145 146 __wyhash64_state_t state = 0; 147 158 148 // Write the frame information 159 149 frame.number = i; 160 150 for( unsigned x = 0; x < fsize; x++ ) { 161 frame.data[x] = i;151 frame.data[x] = __wyhash64(state); 162 152 } 163 153 std::cout << "Simulated " << i << std::endl; … … 187 177 188 178 std::cout << "Rendered " << i << std::endl; 189 assert(total == i * fsize);179 // assert(total == i * fsize); 190 180 191 181 // Release … … 201 191 int main(int argc, char * argv[]) { 202 192 nframes = 3; 203 fsize = 1000;193 fsize = 3840 * 2160 * 4 * 4; 204 194 nproduce = 60; 205 206 const char * framework;207 195 208 196 for(;;) { … … 222 210 // Exit Case 223 211 case -1: 224 /* paranoid */ assert(optind <= argc);225 if( optind == argc ) {226 std::cerr << "Must specify a framework" << std::endl;227 goto usage;228 229 }230 framework = argv[optind];231 212 goto run; 232 213 case 'b': … … 261 242 std::cerr << opt << std::endl; 262 243 usage: 263 std::cerr << "Usage: " << argv[0] << " [options] framework" << std::endl;244 std::cerr << "Usage: " << argv[0] << " [options]" << std::endl; 264 245 std::cerr << std::endl; 265 246 std::cerr << " -b, --buff=COUNT Number of frames to buffer" << std::endl; … … 270 251 } 271 252 run: 272 assert( framework );273 274 253 frames.reset(new Frame[nframes]); 275 254 for(unsigned i = 0; i < nframes; i++) { … … 280 259 std::cout << "(Buffering " << nframes << ")" << std::endl; 281 260 282 thrdlib::init( framework,2 );261 thrdlib::init( 2 ); 283 262 284 263 thread_t stats = thrdlib::create( Stats );
Note: See TracChangeset
for help on using the changeset viewer.