Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-15 07:42:32

0001 #pragma once
0002 /**
0003 srng_traits.h : common RNG traits interface
0004 ===========================================
0005 
0006 Shared CPU/GPU generation headers should accept an RNG object explicitly
0007 instead of depending on an include-order-selected global RNG alias.
0008 
0009 Concrete RNG headers specialize srng<T> and provide uniform accessors.
0010 **/
0011 
0012 #if defined(__CUDACC__) || defined(__CUDABE__)
0013 #define SRNG_METHOD __device__
0014 #else
0015 #define SRNG_METHOD inline
0016 #endif
0017 
0018 template <typename T> struct srng;
0019 
0020 template <typename Rng> SRNG_METHOD float srng_uniform(Rng &rng)
0021 {
0022     return srng<Rng>::uniform(rng);
0023 }
0024 
0025 template <typename Rng> SRNG_METHOD double srng_uniform_double(Rng &rng)
0026 {
0027     return srng<Rng>::uniform_double(rng);
0028 }