简体   繁体   中英

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.

PS

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM