# Block Sparse Matrix

**URL:** <https://discourse.julialang.org/t/block-sparse-matrix/81465>\
**Category:** General Usage\
**Tags:** sparse\
**Created:** [May 22, 2022, 3:18pm UTC](https://discourse.julialang.org/t/block-sparse-matrix/81465 "2022-05-22T15:18:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [September 27, 2022, 2:02pm UTC](https://discourse.julialang.org/t/block-sparse-matrix/81465/2 "2022-09-27T14:02:15Z")

</div>

It took me a while to find this, I recalled the first package that I put at the top of the list (maybe none applies to you, but posting just in case, what I found while searching):

> [@\[ANN\] Fast SpMv with CompressedSparseBlocks.jl](https://discourse.julialang.org/t/ann-fast-spmv-with-compressedsparseblocks-jl/84680):
>
> If you have a computation with an iteration where the time is dominated by a large sparse matrix multiplication, julia\> using LinearAlgebra, SparseArrays, BenchmarkTools julia\> n = 2^22; d = 10; A = sprand(n,n,d/n); x = rand(n); julia\> y = @btime $A\*$x; 909.738 ms (2 allocations: 32.00 MiB) julia\> yt = @btime $(transpose(A))\*$x; 640.637 ms (2 allocations: 32.00 MiB) you may want to consider the [CompressedSparseBlocks](https://github.com/fcdimitr/CompressedSparseBlocks.jl) package, a Julia wrapper to the [CSB Library](https://github.com/PASSIONLab/CSB). julia\> using Compressed…

> [@\[ANN\] Announcing ThreadedSparseCSR.jl](https://discourse.julialang.org/t/ann-announcing-threadedsparsecsr-jl/71343):
>
> [ThreadedSparseCSR.jl](https://github.com/BacAmorim/ThreadedSparseCSR.jl) provides a multithreaded version of CSR matrix - vector multiplication in Julia. The CSR matrix format is implemented in the Julia package [SparseMatricesCSR.jl](https://github.com/gridap/SparseMatricesCSR.jl), which must be installed for this package to work. The package exports the functions: tmul!(y, A, x, [alpha], [beta]), 5 argument (y = alpha\*A\*x +beta\*y ) and 3 argument (y = A\*x) in-place multithreaded versions of mul!, using Base.Threads threading (using @spawn) tmul(A, x), multithreaded version of A\*x, using Ba…

> [@\[ANN\] Announcing ThreadedSparseCSR.jl](https://discourse.julialang.org/t/ann-announcing-threadedsparsecsr-jl/71343):
>
> [ThreadedSparseCSR.jl](https://github.com/BacAmorim/ThreadedSparseCSR.jl) provides a multithreaded version of CSR matrix - vector multiplication in Julia. The CSR matrix format is implemented in the Julia package [SparseMatricesCSR.jl](https://github.com/gridap/SparseMatricesCSR.jl), which must be installed for this package to work. The package exports the functions: tmul!(y, A, x, [alpha], [beta]), 5 argument (y = alpha\*A\*x +beta\*y ) and 3 argument (y = A\*x) in-place multithreaded versions of mul!, using Base.Threads threading (using @spawn) tmul(A, x), multithreaded version of A\*x, using Ba…

> [@Best way to use CuSparseMatrixBSR](https://discourse.julialang.org/t/best-way-to-use-cusparsematrixbsr/86075):
>
> I’ve been writing a set of kernels in which I calculate many small (mostly on the order of ~10x10) square matrices column by column, like in this toy example using CUDA # each slice L[:, :, j] is a matrix of interest Ls = CUDA.rand(3, 3, 100) f(x) = 3 \* x - 2 function matrix\_kernel(f, Ls) ind = (blockIdx().x - 1) \* blockDim().x + threadIdx().x stride = gridDim().x \* blockDim().x sz = size(Ls) len = sz[2] \* sz[3] for i in ind : stride : len m, n = Tuple(CartesianInd…

---

_[View the full topic](https://discourse.julialang.org/t/block-sparse-matrix/81465)._
