Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #include "QUDARAP_API_EXPORT.hh"
0002 #include <stdio.h>
0003 #include "qprop.h"
0004 
0005 
0006 template <typename T>
0007 __global__ void _QProp_lookup( qprop<T>* prop, T* lookup , const T* domain , unsigned iprop, unsigned domain_width )
0008 {
0009     unsigned ix = blockIdx.x * blockDim.x + threadIdx.x;
0010     if (ix >= domain_width ) return;
0011 
0012     T x = domain[ix] ; 
0013     T y = prop->interpolate( iprop, x ); 
0014     unsigned index = iprop * domain_width + ix ;
0015 
0016     //if( iprop == 0 )
0017     //printf("//_QProp_lookup ix %3d x %10.4f  iprop %d  y %10.4f prop->width %3d prop->height %3d \n", ix, x, iprop, y, prop->width, prop->height ); 
0018 
0019     lookup[index] = y ; 
0020 }
0021 
0022 // NB this cannot be extern "C" as need C++ name mangling for template types
0023 
0024 template <typename T> extern void QProp_lookup(
0025     dim3 numBlocks, 
0026     dim3 threadsPerBlock, 
0027     qprop<T>* prop, 
0028     T* lookup, 
0029     const T* domain, 
0030     unsigned iprop, 
0031     unsigned domain_width
0032 )
0033 {
0034     _QProp_lookup<T><<<numBlocks,threadsPerBlock>>>( prop, lookup, domain, iprop, domain_width ) ;
0035 } 
0036 
0037 
0038 template void QProp_lookup(dim3, dim3, qprop<double>*, double*, double const*, unsigned int, unsigned int) ; 
0039 template void QProp_lookup(dim3, dim3, qprop<float>*, float*, float const*, unsigned int, unsigned int) ; 
0040 
0041