Changeset 9fce2572 for libcfa/src
- Timestamp:
- Nov 21, 2022, 5:52:57 PM (21 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 857081e
- Parents:
- 910e1d0
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/random.hfa
r910e1d0 r9fce2572 10 10 // Created On : Fri Jan 14 07:18:11 2022 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Nov 19 17:47:43202213 // Update Count : 812 // Last Modified On : Mon Nov 21 17:50:12 2022 13 // Update Count : 15 14 14 // 15 15 … … 18 18 #include <stdint.h> 19 19 20 // Set default PRNG for architecture size. 20 21 #ifdef __x86_64__ // 64-bit architecture 21 22 #define LEHMER64 … … 24 25 #endif // __x86_64__ 25 26 27 // C/CFA PRNG name and random-state. 28 #ifdef LEHMER64 29 #define PRNG_NAME lehmer64 30 #define PRNG_ARG_T __uint128_t 31 #endif // LEHMER64 32 33 #ifdef XORSHIFT_6_21_7 34 #define PRNG_NAME xorshift_6_21_7 35 #define PRNG_ARG_T uint32_t 36 #endif // XORSHIFT_6_21_7 37 38 #ifdef __cforall // don't include in C code (invoke.h) 39 26 40 // Pipelined to allow out-of-order overlap with reduced dependencies. Critically, the current random state is returned 27 41 // (copied), and then compute and store the next random value. … … 29 43 #if defined(__SIZEOF_INT128__) 30 44 //-------------------------------------------------- 31 #ifdef LEHMER6432 #define PRNG_ARG_T __uint128_t33 #define PRNG_NAME lehmer6434 #endif // LEHMER6435 36 45 static inline uint64_t lehmer64( __uint128_t & state ) { 37 46 __uint128_t ret = state; … … 62 71 63 72 //-------------------------------------------------- 64 65 #ifdef XORSHIFT_6_21_766 #define PRNG_ARG_T uint32_t67 #define PRNG_NAME xorshift_6_21_768 #endif // XORSHIFT_6_21_769 70 73 static inline uint32_t xorshift_6_21_7( uint32_t & state ) { 71 74 uint32_t ret = state; … … 78 81 //-------------------------------------------------- 79 82 typedef struct { 80 81 83 uint32_t a, b, c, d; 84 uint32_t counter; 82 85 } xorwow__state_t; 83 86 … … 133 136 #undef C 134 137 #undef D 138 139 #endif // __cforall -
libcfa/src/concurrency/invoke.h
r910e1d0 r9fce2572 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 18 12:20:26202213 // Update Count : 4912 // Last Modified On : Mon Nov 21 17:40:24 2022 13 // Update Count : 55 14 14 // 15 15 … … 17 17 #include "bits/defs.hfa" 18 18 #include "bits/locks.hfa" 19 #include "bits/random.hfa" 19 20 #include "kernel/fwd.hfa" 20 21 … … 222 223 struct processor * last_proc; 223 224 224 __uint128_trandom_state; // fast random numbers225 PRNG_ARG_T random_state; // fast random numbers 225 226 226 227 #if defined( __CFA_WITH_VERIFY__ )
Note: See TracChangeset
for help on using the changeset viewer.