Sklert
Sklert

Reputation: 242

CUDA: complex scalar * double sparse matrix * double vector

I need a function that performs operation y = y + s*A*x on CUDA. Where y is complex vector (cuDoubleComplex, for instance), x is double vector, A is double sparse matrix (csr format) and s is complex scalar.

Question: Is there any library to perform that operation?

I would like to skip transformation everything to complex, unless you convince me that it can be done efficiently.

P.S.

Unfortunately, it can't be done by cusparse functioncusparseCsrmvEx()

Upvotes: 0

Views: 146

Answers (1)

talonmies
talonmies

Reputation: 72343

Is there any library to perform that operation?

Almost certainly not. The type promotion you need to do pretty much rules that out. What you could to is something like:

  1. cusparseDcsrmv to yield z0 = A*x
  2. custom kernel or perhaps thrust operation to yield z1 = complex(z0)
  3. cublas Zaxpy to calculate y = y + s * z1

Even better would be to write a custom kernel to fuse (2) and (3) together. Your choice.

Upvotes: 1

Related Questions