Hello, I have a problem in cusparseDcsrmv with symmetric matrix. It works in 10 times faster when I use cusparseSetMatType(descra, CUSPARSE_MATRIX_TYPE_GENERAL) then I use cusparseSetMatType(descra,CUSPARSE_MATRIX_TYPE_SYMMETRIC). I got an answer in my last topic : “The multiplication with the transpose of the matrix involves the use of atomics, which makes the algorithm relatively slow (consequently the user experience is not surprising). To achieve the highest possible performance, it would probably be best to store the full matrix in memory (even though it is symmetric) and then call the regular sparse-matrix-vector multiplication on it”. But in my opinion it is possible to write an algorithm without matrix transposition:
public void mult() {
for (int i = 0; i<rowPtrA.length-1; i++) {
int origin = rowPtrA[i];
int length = rowPtrA[i+1] - origin;
double vi = vector[i];
for (int j = 0; j < length; j++) {
double val = csrValA[origin+j];
result[i] += valvector[colIndA[origin+j]];
if (j > 0) result[colIndA[origin+j]] += valvi;
}
}
}
When I multiply element of symmetric matrix on appropriate element of vector I take appropriate element in other triangle of symmetric matrix and multiply on appropriate element of vector. So I dont compute matrix transposition.
I thik it is more efficient and faster algorithm then algorithm Ax=(L+D+U)x=(L+D)x+(L^{T})x. Why dont you use this algorithm for working with symmetric matrix?