 #include <cusparse_v2.h>
 
 typedef cusparseStatus_t (*crskernel_t) (cusparseHandle_t handle, cusparseOperation_t transA, 
-                       int m, int n, int nnz, const void           *alpha, 
-                                      const cusparseMatDescr_t descrA, 
-                                                     const void           *csrValA, 
-                                                                    const void *csrRowPtrA, const void *csrColIndA,
-                                                                                   const void           *x, const void           *beta, 
-                                                                                                  void           *y);
+        int m, int n, int nnz, const void           *alpha, 
+        const cusparseMatDescr_t descrA, 
+        const void           *csrValA, 
+        const void *csrRowPtrA, const void *csrColIndA,
+        const void           *x, const void           *beta, 
+        void           *y);
 
-template<typename dt1, typename dt2>
+    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, crskernel_t crskernel)
 {
     if (options & GHOST_SPMV_DOT_ANY) {


    cusparseCreateMatDescr(&descr);
    GHOST_CALL_RETURN(ghost_cu_cusparse_handle(&cusparse_handle));
    
    dt2 *localdot = NULL;
    dt1 *shift = NULL, scale, beta;
    
    one<dt1>(scale);

    GHOST_SPMV_PARSE_ARGS(options,argp,scale,beta,shift,localdot,dt2,dt1);
    
    if (options & GHOST_SPMV_AXPY) {
        one<dt1>(beta);
    } else {
        zero<dt1>(beta);
    }
    
   
    if (localdot || shift) {
       WARNING_LOG("Localdot or shift are not NULL, something went wrong!");
    } 

    crskernel(cusparse_handle,CUSPARSE_OPERATION_NON_TRANSPOSE,mat->nrows,mat->ncols,mat->nnz,&scale,descr,(dt1 *)CR(mat)->cumat->val, CR(mat)->cumat->rpt, CR(mat)->cumat->col, (dt1 *)rhs->cu_val, &beta, (dt1 *)lhs->cu_val);


    return GHOST_SUCCESS;




    /*cusparseHandle_t cusparse_handle;
      cusparseMatDescr_t descr;

      cusparseCreateMatDescr(&descr);
      GHOST_CALL_RETURN(ghost_cu_cusparse_handle(&cusparse_handle));

      double one = 1.;

      cusparseDcsrmv(cusparse_handle,CUSPARSE_OPERATION_NON_TRANSPOSE,mat->nrows,mat->ncols,mat->nnz,&one,descr,(const double *)CR(mat)->cumat->val, CR(mat)->cumat->rpt, CR(mat)->cumat->col, (const double *)rhs->cu_val, &one, (double *)lhs->cu_val);

    //ERROR_LOG("CUDA CRS spMV not implemented");
    //return GHOST_ERR_NOT_IMPLEMENTED;

    INFO_LOG("ready"); 
    return GHOST_SUCCESS;*/

