Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #pragma once
0002 
0003 /**
0004 QBnd
0005 =====
0006 
0007 CUDA-centric equivalent for optixrap/OBndLib 
0008 
0009 Lots of former bnd array and metadata related methods from QBnd 
0010 were relocated down to SBnd as they were unrelated to CUDA, and 
0011 in order to facilitate reuse from eg U4Recorder. 
0012 
0013 * everything in QUDARap should be related to CUDA uploading, downloading, launching 
0014 * anything data preparation related that is not using CUDA should be down in sysrap
0015 
0016 
0017 TODO: consider combine QBnd and QOptical into QOpticalBnd or incorporating 
0018       QOptical within QBnd as bnd and optical are so closely related 
0019       and require coordinated changes when adding dynamic boundaries
0020       as done in SSim::addFake_ 
0021 
0022 **/
0023 
0024 #include <vector>
0025 #include <string>
0026 
0027 #if defined(MOCK_TEXTURE) || defined(MOCK_CUDA)
0028 #else
0029 #include "plog/Severity.h"
0030 #endif
0031 
0032 #include "QUDARAP_API_EXPORT.hh"
0033 
0034 union quad ; 
0035 struct float4 ; 
0036 struct dim3 ; 
0037 struct qbnd ; 
0038 
0039 template <typename T> struct QTex ; 
0040 struct NP ; 
0041 struct NPFold ; 
0042 struct SBnd ; 
0043 
0044 struct QUDARAP_API QBnd
0045 {
0046 #if defined(MOCK_TEXTURE) || defined(MOCK_CUDA)
0047 #else
0048     static const plog::Severity LEVEL ;
0049 #endif
0050     static const QBnd*          INSTANCE ; 
0051     static const QBnd*          Get(); 
0052 
0053     static qbnd* MakeInstance(const QTex<float4>* tex, const std::vector<std::string>& names ); 
0054 
0055     const NP*      dsrc ;  
0056     const NP*      src ;  
0057     SBnd*          sbn ; 
0058 
0059     QTex<float4>*  tex ; 
0060 
0061     qbnd*          qb ;    // formerly bnd 
0062     qbnd*          d_qb ;  // formerly d_bnd
0063 
0064     QBnd(const NP* buf); 
0065     void init(); 
0066 
0067     std::string desc() const ; 
0068 
0069     static QTex<float4>* MakeBoundaryTex(const NP* buf ) ;
0070     static void ConfigureLaunch( dim3& numBlocks, dim3& threadsPerBlock, int width, int height );
0071     static std::string DescLaunch( const dim3& numBlocks, const dim3& threadsPerBlock, int width, int height ); 
0072 
0073     NP*  lookup() const ;
0074     NPFold* serialize() const ; 
0075     void save(const char* dir) const ; 
0076 
0077     void lookup( quad* lookup, int num_lookup, int width, int height ) const ;
0078     static std::string Dump(   quad* lookup, int num_lookup, int edgeitems=10 );
0079 
0080 };
0081 
0082