How to use Cusparse for BSR SPMV?

Hi all,
How should I implementing SPMV in bsr format using CuSparse? I tried using related format api like cusparseCreateConstBsr and compute api cusparseSpMV, but occured an error : ** On entry to cusparseSpMV_bufferSize(): sparse matrix format BSR is not supported. What’s the right way to do this computation?
Is there any demo code I can refer to?
Thank you

The documentation for cusparseSpMV indicates:

The sparse matrix formats currently supported are listed below:

  • CUSPARSE_FORMAT_COO
  • CUSPARSE_FORMAT_CSR
  • CUSPARSE_FORMAT_CSC
  • CUSPARSE_FORMAT_SLICED_ELL

BSR is not one of those.

Some possibilities:

  • switch your storage format to one of the supported ones for this op
  • convert your BSR matrix to one of the supported types for this op
  • use cusparse<t>bsrmv()

The CUDA library sample codes are here but I don’t know that any pertain to BSR usage. However I think a csrmv example should be pretty close to bsrmv, such as this one. This portion of the documentation may also be of interest.