 }
 
 //will free idata
+// this computes the difference / approximates the derivative of idata
 float* diff(float* idata, uint3 _sizes, int order, int dim)
 {
 	unsigned int* sizes = (unsigned int*)&_sizes;

	dim3 threads2(CONVN_THREAD_SIZE1, CONVN_THREAD_SIZE2, 1);
	dev_convn<<<grid2, threads2>>>(idata, odata, sizes[0], sizes[1], sizes[0], sizes[0]*sizes[1], sizes[2], filt, filtlen);
        cutilCheckMsg("dev_convn() execution failed\n");
}

// odata must be pre-allocated
// filtlen can not be greater than CONVN_THREAD_SIZE2
void conv3D(float* idata, float* odata, dim3 _sizes, const float* filt, int filtlen) {
	unsigned int* sizes = (unsigned int*)&_sizes;
	float* tmp;

	}
}

// parallel subtraction
__global__ void dev_sub(float *i1data, float *i2data, float* odata, int len) {
	const int     tid = IMUL(blockDim.x, blockIdx.x) + threadIdx.x;
	const int threadN = IMUL(blockDim.x, gridDim.x);
