File indexing completed on 2026-04-09 07:49:33
0001 #pragma once
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include "curand_kernel.h"
0024
0025 #if defined(__CUDACC__) || defined(__CUDABE__)
0026 #else
0027 #include <string>
0028 #include <sstream>
0029 #include <iostream>
0030 #include <iomanip>
0031 #endif
0032
0033
0034 template<typename T>
0035 struct scurandref
0036 {
0037 unsigned long long chunk_idx ;
0038 unsigned long long chunk_offset ;
0039
0040 unsigned long long num ;
0041 unsigned long long seed ;
0042 unsigned long long offset ;
0043 T* states ;
0044
0045 #if defined(__CUDACC__) || defined(__CUDABE__)
0046 #else
0047 std::string desc() const ;
0048 #endif
0049
0050 };
0051
0052
0053 #if defined(__CUDACC__) || defined(__CUDABE__)
0054 #else
0055 template<typename T>
0056 inline std::string scurandref<T>::desc() const
0057 {
0058 std::stringstream ss ;
0059 ss << "scurandref::desc"
0060 << " chunk_idx " << std::setw(4) << chunk_idx
0061 << " chunk_offset/M " << std::setw(4) << chunk_offset/1000000
0062 << " num/M " << std::setw(4) << num/1000000
0063 << " seed " << seed
0064 << " offset " << offset
0065 << " states " << states
0066 << "\n"
0067 ;
0068 std::string str = ss.str() ;
0069 return str ;
0070 }
0071 #endif
0072
0073
0074