Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #pragma once
0002 /**
0003 QProp : setup to allow direct (no texture) interpolated property access on device 
0004 =====================================================================================
0005 
0006 See NP::Combine for the construction of compound prop array 
0007 from many indiviual prop arrays with various domain lengths 
0008 and differing domain values 
0009 
0010 See ~/np/tests/NPInterp.py for prototyping the linear interpolation 
0011 
0012 QProp vs textures
0013 ---------------------
0014 
0015 GPU texture interpolation does something very similar to qprop::interpolate 
0016 but QProp has the advantage that it can handle multiple properties all with 
0017 different numbers of items. This removes the need with textures to  establish 
0018 a common domain and pre-interpolate everything to use that domain. 
0019 
0020 The QProp approach is very close to what Geant4 does, the texture approach 
0021 is likely faster but takes more effort to setup and probably requires fine
0022 textures to reproduce the Geant4 results. 
0023 
0024 **/
0025 
0026 #include <vector>
0027 #include <string>
0028 #include "plog/Severity.h"
0029 #include "QUDARAP_API_EXPORT.hh"
0030 
0031 union quad ; 
0032 struct float4 ; 
0033 struct dim3 ; 
0034 template <typename T> struct qprop ; 
0035 struct NP ; 
0036 
0037 template <typename T>
0038 struct QUDARAP_API QProp
0039 {
0040     static const plog::Severity LEVEL ;
0041     static const QProp<T>*  INSTANCE ; 
0042     static const QProp<T>*  Get(); 
0043 
0044     const NP* a  ;  
0045     const T* pp ; 
0046     unsigned nv ; 
0047 
0048     unsigned ni ; 
0049     unsigned nj ; 
0050     unsigned nk ; 
0051 
0052     qprop<T>* prop ; 
0053     qprop<T>* d_prop ; 
0054 
0055     QProp(const NP* a); 
0056 
0057     virtual ~QProp(); 
0058     void init(); 
0059     void upload(); 
0060     void cleanup(); 
0061 
0062     void dump() const ; 
0063     std::string desc() const ;
0064     qprop<T>* getDevicePtr() const ;
0065     void lookup( T* lookup, const T* domain,  unsigned num_prop, unsigned domain_width ) const ; 
0066     void lookup_scan(T x0, T x1, unsigned nx, const char* fold, const char* reldir=nullptr ) const ; 
0067 
0068 };
0069 
0070