 
 #define IU_BSPLINE_POLE (sqrtf(3.0f)-2.0f)  // pole for cubic b-spline
 
-template<class floatN> __device__ floatN InitialCausalCoefficient(
-  floatN* c,        // coefficients
+template<class PixelType> __device__ PixelType InitialCausalCoefficient(
+  PixelType* c,        // coefficients
   unsigned int DataLength,  // number of coefficients
   int step)
 {

#undef IU_BSPLINE_POLE

//-----------------------------------------------------------------------------
template<class floatN> __global__ void cuSamplesToCoefficients2DX(
  floatN* image, unsigned int width, unsigned int height, size_t stride)
{
  const unsigned int y = blockIdx.x * blockDim.x + threadIdx.x;
  if (y < height)
  {
    // process lines in x-direction
    floatN* line = image + y * stride;  //direct access

    ConvertToInterpolationCoefficients(line, width, 1);
  }
}

//-----------------------------------------------------------------------------
template<class floatN> __global__ void cuSamplesToCoefficients2DY(
  floatN* image, unsigned int width, unsigned int height, size_t stride)
{
  const unsigned int x = blockIdx.x * blockDim.x + threadIdx.x;
  if (x < width)
  {
    // process lines in y-direction
    floatN* line = image + x;  //direct access

    ConvertToInterpolationCoefficients(line, height, stride);
  }

  // this initialization corresponds to mirror boundaries
  // accelerated loop
  float zn = IU_BSPLINE_POLE;
  PixelType Sum = *c;
  for (unsigned int n = 1; n < Horizon; n++) {
    c += step;
    Sum += zn * *c;
