 
 		cuFloatComplex result = dst[i];
 
-		for (uint kz = 0; kz < config.kdims[2]; kz++) {
-
-			int oz = iz - kz;
+		for (long kz = 0; kz < (long)config.kdims[2]; kz++) {
+
+			long oz = (long)iz - kz;
 
 			if ((0 > oz) || ((int)config.odims[2] <= oz))
 				continue;
 
 			long offset_z = config.N_out_elements_k_only * config.odims[0] * config.odims[1] * oz + config.NC * config.kdims[0] * config.kdims[1] * kz;
 
-			for (uint ky = 0; ky < config.kdims[1]; ky++) {
-
-				int oy = iy - ky;
+			for (long ky = 0; ky < (long)config.kdims[1]; ky++) {
+
+				long oy = (long)iy - ky;
 
 				if ((0 > oy) || ((int)config.odims[1] <= oy))
 					continue;
 
 				long offset_y = config.N_out_elements_k_only * config.odims[0] * oy + config.NC * config.kdims[0] * ky;
 
-				for (uint kx = 0; kx < config.kdims[0]; kx++) {
-
-					int ox = ix - kx;
+				for (long kx = 0; kx < (long)config.kdims[0]; kx++) {
+
+					long ox = (long)ix - kx;
 					long offset_x = config.N_out_elements_k_only * ox + config.NC * kx;
 					long index = c 	+ offset_x + offset_y + offset_z;
 

		config.N_out_elements_k_only *= kdims[i];
		config.N_out_elements *= odims[i] * kdims[i];

		config.triv_strides_dilation &= 
				(   (config.istrs_odims[j] == istrs[i])
				 && (config.istrs_kdims[j] == istrs[i]));



		cuFloatComplex result = dst[i];

		for (int kz = 0; kz < (int)config.kdims[2]; kz++) {

			int oz = (int)iz - kz;

			if ((0 > oz) || ((int)config.odims[2] <= oz))
				continue;

			long offset_z = config.N_out_elements_k_only * config.odims[0] * config.odims[1] * oz + config.NC * config.kdims[0] * config.kdims[1] * kz;

			for(int ky = 0; ky < (int)config.kdims[1]; ky++) {

				int oy = (int)iy - ky;

				if ((0 > oy) || ((int)config.odims[1] <= oy))
					continue;

				long offset_y = config.N_out_elements_k_only * config.odims[0] * oy + config.NC * config.kdims[0] * ky;

				for (int kx = 0; kx < (int)config.kdims[0]; kx++) {

					int ox = (int)ix - kx;

					long offset_x = config.N_out_elements_k_only * ox + config.NC * kx;

