         void           *y, int ldy);
 
     template<typename dt1, typename dt2>
-static ghost_error_t ghost_cu_crsspmv_tmpl(ghost_sparsemat_t *mat, ghost_densemat_t * lhs, ghost_densemat_t * rhs, ghost_spmv_flags_t options, va_list argp, cusparse_crs_spmv_kernel_t crskernel)
+static ghost_error_t ghost_cu_crsspmv_tmpl(ghost_sparsemat_t *mat, ghost_densemat_t * lhs, ghost_densemat_t *origlhs, ghost_densemat_t * rhs, ghost_spmv_flags_t options, va_list argp, cusparse_crs_spmv_kernel_t crskernel)
 {
     cusparseHandle_t cusparse_handle;
     cusparseMatDescr_t descr;

        PERFWARNING_LOG("Dot product computation will be not be done on-the-fly!");
        memset(localdot,0,lhs->traits.ncols*3*sizeof(dt1));
        if (options & GHOST_SPMV_DOT_YY) {
            lhs->dot(lhs,&localdot[0],lhs);
        }
        if (options & GHOST_SPMV_DOT_XY) {
            lhs->dot(lhs,&localdot[lhs->traits.ncols],rhs);
        }
        if (options & GHOST_SPMV_DOT_XX) {
            rhs->dot(rhs,&localdot[2*lhs->traits.ncols],rhs);

err:
    ERROR_LOG("Error in CRS SpMV!");
out:
    if (lhs != lhs_in) {
        lhs->destroy(lhs);
    }
    if (rhs != rhs_in) {
        rhs->destroy(rhs);
    }

    return ret;
