
/**********************************/
/**********************************/
__global__ void Dx(int3 *Imag_dst,uchar3 *Imag_src,int N,int Width)
{
	// Calcule the identify number
    int idx = /*HERE*/;
	
    // What is the condition
    if (/*HERE*/){
		if (idx%Width==0){//Cero en los bordes
			Imag_dst[idx].x=0;
			Imag_dst[idx].y=0;
			Imag_dst[idx].z=0;
		}
		else{
			// Calculate the derivate on "x"
            /*HERE*/ // for the first channel
            /*HERE*/ // for the second channel
            /*HERE*/ // for the third channel
        }
	}
}


/**********************************/
/**********************************/
__global__ void Dy(int3 *Imag_dst,uchar3 *Imag_src,int N,int Width)
{
	// Calcule the identify number
    /*HERE*/
	
    // What is the condition?
	/*HERE*/{
		if(idx<Width){//Cero en los bordes
			Imag_dst[idx].x=0.0;
			Imag_dst[idx].y=0.0;
			Imag_dst[idx].z=0.0;
		}
		else{
            // Calculate the derivate on "y"
            /*HERE*/ // for the first channel
            /*HERE*/ // for the second channel
            /*HERE*/ // for the third channel
		} 
	}


}

/**********************************/
/**********************************/
__global__ void MG(float *ImageMG_dev,int3 *ImagDx_dev,int3 *ImagDy_dev,int N)
{
    // Calcule the identify number
    /*HERE*/
	
	int3 dx,dy;
	float cuad1,cuad2,mag_g;

    // What is the condition?
    /*HERE*/{
		dx=ImagDx_dev[idx];
		dy=ImagDy_dev[idx];
		cuad1=dx.x*dx.x+dx.y*dx.y+dx.z*dx.z;
		cuad2=dy.x*dy.x+dy.y*dy.y+dy.z*dy.z;
		mag_g=sqrtf(cuad1+cuad2);
		ImageMG_dev[idx]=mag_g;
	}

}

/**********************************/
/**********************************/
extern "C"
void CUDA_Dx(int3 *ImageDx_dev,uchar3 *Image_dev,int N,int imageW,dim3 grid,dim3 threads){
    // Call the kernel "Dx"
	/*HERE*/
}

/**********************************/
/**********************************/
extern "C"
void CUDA_Dy(int3 *ImageDy_dev,uchar3 *Image_dev,int N,int imageW,dim3 grid,dim3 threads){
    // Call the kernel "Dy"
    /*HERE*/
}

/**********************************/
/**********************************/
extern "C"
void CUDA_MG(float *ImageMG_dev,int3 *ImageDx_dev,int3 *ImageDy_dev,int N,dim3 grid,dim3 threads){
    // Call the kernel "MG"
    /*HERE*/
}