 
     dim3 threads(32, 8);
     dim3 grid(divUp(dst.cols, threads.x), divUp(dst.rows, threads.y));
-    float sx = static_cast<float>(src.cols) / dst.cols;
+    
+	float sx = static_cast<float>(src.cols) / dst.cols;
     float sy = static_cast<float>(src.rows) / dst.rows;
+
     resize_for_hog_kernel<<<grid, threads>>>(sx, sy, (DevMem2D_<T>)dst, colOfs);
     cudaSafeCall( cudaGetLastError() );
-    cudaSafeCall(cudaThreadSynchronize());
-    cudaSafeCall(cudaUnbindTexture(resize8UC1_tex));
+    cudaSafeCall( cudaThreadSynchronize() );
+    cudaSafeCall( cudaUnbindTexture(tex) );
 }
 
 void resize_8UC1(const DevMem2D& src, DevMem2D dst) { resize_for_hog<uchar> (src, dst, resize8UC1_tex); }

    dim3 threads(nthreads, 1);
    dim3 grid(img_win_width, img_win_height);

    int img_block_width = (width - CELLS_PER_BLOCK_X * CELL_WIDTH + block_stride_x) / 
                          block_stride_x;
    extract_descrs_by_cols_kernel<nthreads><<<grid, threads>>>(
        img_block_width, win_block_stride_x, win_block_stride_y, block_hists, descriptors);
    cudaSafeCall( cudaGetLastError() );

        hidx = (hidx + cnbins) % cnbins;

        ((uchar2*)qangle.ptr(blockIdx.y))[x] = make_uchar2(hidx, (hidx + 1) % cnbins);
        ((float2*)  grad.ptr(blockIdx.y))[x] = make_float2(mag * (1.f - ang), mag * ang);
    }
}

