Categories
Programming

Writing code using cuBLAS and cuSPARSE

When starting to use a new API or library, I’m usually find myself overwhelmed by the whole process. The main issue, I believe, is that the only way to learn how to program is by… well, programming (and I don’t mean it as a joke, but if you must insist…).

Often enough, I find the examples terribly hard to follow. Usually, the problem lies in that there is a single example that tries to show all the features in the program. That approach is a very good way to quickly refresh your memory on how to use a library you already know how to use, but not necessarily useful for a first-timer. In other words, it’s only easy after you know how to do it.

Thinking about this, I’ve created a really really simple CUBLAS example. The code is available here: CUBLAS Sample.zip

For those familiar with BLAS/LAPACK and CUDA, there’s not a whole lot of difference, but I think you’ve gotta drink milk before you eat solid food.

For those who are interested, you can check out a presentation I’ve given at MSU about cuBLAS and cuSPARSE on Oct. 22 2013: cuBLAS and cuSPARSE presentation.pdf

The code for the 2D Jacobi Iteration that I’ve used is here with the approval of Prof. Christlieb: 2DJacobiBlasSparse.zip

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.