O'Reilly logo

OpenCL Parallel Programming Development Cookbook by Raymond Tay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding how to solve SpMV using the CSR format

After viewing all these different data representations for sparse matrices, you will probably realize there's more to the picture than we earlier imagined, and this serves to highlight the fact that researchers and engineers have spent a lot of time and effort to solve what looks like a deceptively simple problem in an efficient manner. Hence in this section, we are going to take a look at how to solve the SpMV problem using the CSR format looking at various recipes from sequential, scalar, and finally vector kernels in that order.

Getting ready

Now, let us take a look at what SpMV code would look like in its sequential form, that is, when executed on a modern CPU, using the CSR format, and then ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required