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
0017
0018
0019 lookup[index] = y ;
0020 }
0021
0022
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