   cutStopTimer( timer );  /// Stop timer
   printf("Gaussian time = %f ms\n",cutGetTimerValue( timer ));
 
+  return(d_img);
 
 }
 

  cudaMalloc((void**) &d_image, imageSize);
  CUT_CHECK_ERROR("Image memory creation failed");

//  gpuInput(image,d_image,size.z);
  cudaMemcpy(d_image,image,size.z*sizeof(float),cudaMemcpyHostToDevice);

  cudaGaussian(d_image,size,gaussianVariance,maxKernelWidth);

  /// alocate memory on gpu for direction
  short2 *d_direction;

  cudaMalloc((void**) &d_magnitude, size.z*sizeof(float));
  CUT_CHECK_ERROR("Memory temporary image creation failed");

  cudaSobel(d_magnitude,d_direction,d_blur,size);

  gradientMaximumDetector(d_image,d_magnitude,d_direction,size,maxKernelWidth);

