00001 #ifndef CUDA_MERSENNETWISTER_H_DEFINED 00002 #define CUDA_MERSENNETWISTER_H_DEFINED 00003 00004 00005 #define DCMT_SEED 4172 00006 #define MT_RNG_PERIOD 607 00007 00008 00009 typedef struct{ 00010 unsigned int matrix_a; 00011 unsigned int mask_b; 00012 unsigned int mask_c; 00013 unsigned int seed; 00014 } mt_struct_stripped; 00015 00016 00017 #define MT_RNG_COUNT 4096 00018 #define MT_MM 9 00019 #define MT_NN 19 00020 #define MT_WMASK 0xFFFFFFFFU 00021 #define MT_UMASK 0xFFFFFFFEU 00022 #define MT_LMASK 0x1U 00023 #define MT_SHIFT0 12 00024 #define MT_SHIFTB 7 00025 #define MT_SHIFTC 15 00026 #define MT_SHIFT1 18 00027 00028 00029 void seedMTGPU(unsigned int seed); 00030 00031 00032 #endif 00033