   int xx, yy;
 
   // output size
-  int output_w = (input_w - kW) / dW + 1;
-  int output_h = (input_h - kH) / dH + 1;
+  int output_w = ceil(float(input_w - kW) / float(dW) + 1);
+  int output_h = ceil(float(input_h - kH) / float(dH) + 1);
 
   // compute offsets based on thread/block ID
   int o = blockIdx.x;

  int xx, yy;

  // output size
  int output_w = (input_w - kW) / dW + 1;
  int output_h = (input_h - kH) / dH + 1;

  // compute offsets based on thread/block ID
  int o = blockIdx.x;

  int xx, yy;

  // output size
  const int output_w = ceil(float(input_w - kW) / float(dW) + 1);
  const int output_h = ceil(float(input_h - kH) / float(dH) + 1);

  // compute offsets based on thread/block ID
  int o = blockIdx.x;
