 					  int paddingXY, int paddingZ,
 					  DeviceArray3D< float2 > outputGrid )
 {
+    #ifndef JRK_SCHEDULE
 	int x = blockIdx.x * blockDim.x + threadIdx.x;
 	int y = blockIdx.y * blockDim.y + threadIdx.y;
 

#include <MathUtils.h>

#include <cutil_math.h>

// TODO: be very careful with this variable
texture< float2, cudaTextureType2D, cudaReadModeElementType > g_gridTexture( 0, cudaFilterModeLinear );


	dim3 blockDim( 16, 16, 1 );

#ifndef JRK_SCHEDULE
	int gx = numBins( md_dataImage.width(), blockDim.x );
	int gy = numBins( md_dataImage.height(), blockDim.y );
#else
	int gx = numBins( numBins(md_dataImage.width(), m_samplingSpatial), blockDim.x );
	int gy = numBins( numBins(md_dataImage.height(), m_samplingSpatial), blockDim.y );
#endif
	dim3 gridDim( gx, gy, 1 );

	createGridKernel<<< gridDim, blockDim >>>
