Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:33

0001 #pragma once
0002 
0003 /**
0004 scurandref : NOT GENERAL : SPECIFIC TO curandStateXORWOW
0005 ===========================================================
0006 
0007 chunk_idx
0008    index of the chunk
0009 chunk_offset
0010    number of state slots prior to this chunk 
0011 
0012 num
0013    number of state slots in the *chunk_idx* chunk
0014 
0015 seed
0016    input to curand_init, default 0 
0017 offset 
0018    input to curand_init, default 0 
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