i've used the function named in the topic (magma_<t>cuspmm - magma/sparse-iter/src/magma_scuspmm.cpp). And i think there is a little Bug (look at the numbers of rows and cols from A and B):

Line 124:

Code: Select all

```
cusparseXcsrgemmNnz(handle, CUSPARSE_OPERATION_NON_TRANSPOSE,
CUSPARSE_OPERATION_NON_TRANSPOSE,
A.num_rows, A.num_rows, A.num_rows,
descrA, A.nnz, A.drow, A.dcol,
descrB, B.nnz, B.drow, B.dcol,
descrC, C.drow, nnzTotalDevHostPtr );
```

Code: Select all

```
cusparseXcsrgemmNnz(handle, CUSPARSE_OPERATION_NON_TRANSPOSE,
CUSPARSE_OPERATION_NON_TRANSPOSE,
A.num_rows, B.num_cols, A.num_cols,
descrA, A.nnz, A.drow, A.dcol,
descrB, B.nnz, B.drow, B.dcol,
descrC, C.drow, nnzTotalDevHostPtr );
```

Code: Select all

```
cusparseScsrgemm(handle, CUSPARSE_OPERATION_NON_TRANSPOSE,
CUSPARSE_OPERATION_NON_TRANSPOSE,
A.num_rows, A.num_rows, A.num_rows,
descrA, A.nnz,
A.dval, A.drow, A.dcol,
descrB, B.nnz,
B.dval, B.drow, B.dcol,
descrC,
C.dval, C.drow, C.dcol);
```

Code: Select all

```
cusparseScsrgemm(handle, CUSPARSE_OPERATION_NON_TRANSPOSE,
CUSPARSE_OPERATION_NON_TRANSPOSE,
A.num_rows, B.num_cols, A.num_cols,
descrA, A.nnz,
A.dval, A.drow, A.dcol,
descrB, B.nnz,
B.dval, B.drow, B.dcol,
descrC,
C.dval, C.drow, C.dcol);
```