2 __device__ void Bisection_device(T z, T* t, int mi, int ma, int* l)
14 /* Kernel to evaluates monotone spline for a sequence of query points residing in the array z of size m
16 template<typename Tx, typename Ty>
17 __global__ void d_MonSplineValue(Tx* z, int K, double* t, double * alpha, double * beta, double * gamma, int T, Ty *value)
19 int tid = threadIdx.x + blockIdx.x * blockDim.x;
24 Bisection_device(z[tid], t, mi, ma, &i);
26 r= alpha[i] + r*(beta[i] + gamma[i]*r);
28 tid += blockDim.x * gridDim.x;
33 template<typename Tx, typename Ty>
34 void MonotoneSplineValue(Tx *z, int K, double* t,
35 double * alpha, double * beta, double * gamma, int T, Ty* result)
37 int blocks,threads=256;
38 blocks=(K-1)/threads+1;
39 d_MonSplineValue<<<blocks,threads>>>(z,K,t,alpha,beta,gamma,T,result);