Changes in tests/PRNG.cfa [470618c0:5910fc0]
- File:
-
- 1 edited
-
tests/PRNG.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/PRNG.cfa
r470618c0 r5910fc0 8 8 // Created On : Wed Dec 29 09:38:12 2021 9 9 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Sat Feb 12 12:23:57202211 // Update Count : 3 4210 // Last Modified On : Fri Feb 11 08:16:43 2022 11 // Update Count : 328 12 12 // 13 13 … … 20 20 #include <malloc.h> // malloc_stats 21 21 #include <locale.h> // setlocale 22 #include <mutex_stmt.hfa>23 22 24 23 // FIX ME: spurious characters appear in output … … 51 50 } // for 52 51 double std = sqrt( sum / BUCKETS ); 53 mutex( sout )sout | "trials" | TRIALS | "buckets" | BUCKETS54 | "min" | min | "max" | max55 | "avg" | wd(0,1, avg) | "std" | wd(0,1, std) | "rstd" | wd(0,1, (avg == 0 ? 0.0 : std / avg * 100)) | "%";52 sout | "trials" | TRIALS | "buckets" | BUCKETS 53 | "min" | min | "max" | max 54 | "avg" | wd(0,1, avg) | "std" | wd(0,1, std) | "rstd" | wd(0,1, (avg == 0 ? 0.0 : std / avg * 100)) | "%"; 56 55 } // avgstd 57 56 58 59 57 uint32_t seed = 1009; 58 60 59 61 60 thread T1 {}; … … 95 94 unsigned int * buckets = calloc( BUCKETS ); // too big for task stack 96 95 for ( TRIALS ) { 97 buckets[prng( th ) % BUCKETS] += 1; // concurrent96 buckets[prng( (thread$ &)th ) % BUCKETS] += 1; // concurrent 98 97 } // for 99 98 avgstd( buckets );
Note:
See TracChangeset
for help on using the changeset viewer.