Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #pragma once
0002 /**
0003 SRG.h : Raygen Mode
0004 =====================
0005 
0006 **/
0007 
0008 
0009 enum { SRG_RENDER, SRG_SIMTRACE, SRG_SIMULATE, SRG_TEST } ;  
0010 
0011 
0012 #ifndef __CUDACC__
0013 #include <cstdint>
0014 #include <cstring>
0015 struct SRG 
0016 {
0017     static const char* Name(int32_t raygenmode);
0018     static int32_t     Type(const char* name);
0019     static constexpr const char* RENDER_ = "render" ;
0020     static constexpr const char* SIMTRACE_ = "simtrace" ;
0021     static constexpr const char* SIMULATE_ = "simulate" ;
0022     static constexpr const char* TEST_ = "test" ;
0023 };
0024 inline const char* SRG::Name(int32_t raygenmode)
0025 {
0026     const char* s = nullptr ;
0027     switch(raygenmode)
0028     {
0029         case SRG_RENDER:   s = RENDER_   ; break ;
0030         case SRG_SIMTRACE: s = SIMTRACE_ ; break ;
0031         case SRG_SIMULATE: s = SIMULATE_ ; break ;
0032         case SRG_TEST:     s = TEST_     ; break ;
0033     }
0034     return s ; 
0035 }
0036 inline int32_t SRG::Type(const char* name)
0037 {
0038     int32_t type = SRG_RENDER ;
0039     if(strcmp(name,RENDER_) == 0 )   type = SRG_RENDER ;
0040     if(strcmp(name,SIMTRACE_) == 0 ) type = SRG_SIMTRACE ;
0041     if(strcmp(name,SIMULATE_) == 0 ) type = SRG_SIMULATE ;
0042     if(strcmp(name,TEST_) == 0 )     type = SRG_TEST ;
0043     return type ;
0044 }
0045 #endif
0046