Having Error on Kernel Function

Following is my kernel code.

global void doResample( variables… ){

int xx, yy;
xx = blockIdx.x;
yy = blockIdx.y;

if (dev_fft) { 		
	if (xx<XDIM) {
		if (yy<YDIM) {
			if (dev_resample) {
				h_in[yy].x = dev_b[dev_frame*YDIM*XDIM+xx*YDIM+int(dev_resamp[yy*2])]
					- dev_resamp[yy*2+1]*(dev_b[dev_frame*YDIM*XDIM+xx*YDIM+int(dev_resamp[2*yy])+1]-dev_b[dev_frame*YDIM*XDIM+xx*YDIM+int(dev_resamp[2*yy])])/k_resampledspacing;
			else {
			h_in[yy].x = dev_b[dev_frame*YDIM*XDIM+xx*YDIM+yy];
			h_in[yy].y = 0;


The code compiles and I have assigned values that does not exceed the length of array so there should be no problem with the code.
However, whenever I try to execute the code, it somehow shuts down or gives 0. Does anyone have I idea what is going on? Thank you.