             
     }
     
+    if (origlhs != lhs) {
+        PERFWARNING_LOG("Scatter the result back");
+        GHOST_CALL_RETURN(origlhs->fromVec(origlhs,lhs,0,0));
+    }
+    
     return GHOST_SUCCESS;
 }
     
     template<typename dt1, typename dt2>
-static ghost_error_t ghost_cu_crsspmmv_cm_tmpl(ghost_sparsemat_t *mat, ghost_densemat_t * lhs, ghost_densemat_t * rhs, ghost_spmv_flags_t options, va_list argp, cusparse_crs_spmmv_cm_kernel_t crskernel)
+static ghost_error_t ghost_cu_crsspmmv_cm_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_spmmv_cm_kernel_t crskernel)
 {
     cusparseHandle_t cusparse_handle;
     cusparseMatDescr_t descr;

err:
    ERROR_LOG("Error in CRS SpMV!");
out:
    if (lhscompact != lhs) {
        GHOST_CALL_RETURN(lhs->fromVec(lhs,lhscompact,0,0));
        lhscompact->destroy(lhscompact);
    }
    if (rhscompact != rhs) {
        rhscompact->destroy(rhscompact);
    }

    return ret;

    }
    
    CUSPARSE_CALL_RETURN(crskernel(cusparse_handle,CUSPARSE_OPERATION_NON_TRANSPOSE,CUSPARSE_OPERATION_TRANSPOSE,mat->nrows,rhs->traits.ncols,mat->ncols,mat->nnz,&scale,descr,(dt1 *)CR(mat)->cumat->val, CR(mat)->cumat->rpt, CR(mat)->cumat->col, (dt1 *)rhs->cu_val, rhs->stride, &beta, (dt1 *)lhs->cu_val,lhs->stride));
    
    // This needs to be done prior to further computation because lhs is col-major and rhs is row-major.
    if (origlhs != lhs) {
        PERFWARNING_LOG("Transpose the result back");
        GHOST_CALL_RETURN(origlhs->fromVec(origlhs,lhs,0,0));
    }

    if (options & (GHOST_SPMV_SHIFT|GHOST_SPMV_VSHIFT)) {
        PERFWARNING_LOG("Shift will not be applied on-the-fly!");
