Open Source clSPARSE Beta Released

We are happy to announce that we are open sourcing SpeedIT, our first commercial product for sparse linear algebra in OpenCL. We believe this decision will be beneficial for our customers, academia, the community and the HPC market.

Our most efficient kernels from SpeedIT will now be integrated into clSPARSE, an open source OpenCL™ sparse linear algebra library, created in partnership with AMD.

clSPARSE is the fourth library addition to clMathLibraries. It expands upon the available dense clBLAS (Basic Linear Algebra Subprograms), clFFT (Fast Fourier Transform) and clRNG (random number generator) offerings already available.

The source is released under the Apache license as a Beta release. We release this to the public to receive feedback, comments and constructive criticism, which may all be filed as Github issues in the repository’s ticketing system. All of our current issues are open to the public to view and comment on. As a Beta release, we reserve the right to tinker with the API and make changes, all depending on constructive feedback we receive.

At the first release, clSPARSE provides these fundamental sparse operations for OpenCL:

  • Sparse Matrix – dense Vector multiply (SpM-dV)
  • Sparse Matrix – dense Matrix multiply (SpM-dM)
  • Iterative conjugate gradient solver (CG)
  • Iterative biconjugate gradient stabilized solver (BiCGStab)
  • Dense to CSR conversions (& converse)
  • COO to CSR conversions (& converse)
  • Functions to read matrix market files in COO or CSR format

The library source code compiles cross-platform on the back of an advanced cmake build system that allows users to choose to build the library and supporting benchmarks/tests, and takes care of dependencies for them. True to the spirit of the other clMath libraries, clSPARSE exports a “C” interface to allow developers to build wrappers around clSPARSE in any language they need. The advantage of using the open source clMath libraries is that the user does not have to write or understand the OpenCL kernels; the implementation is abstracted from the user allowing to them to focus on memory placement and transport. Still, the source to the kernels is open for those who wish to understand the implementation details.

A great deal of thought and effort went into designing the API’s to make them less ‘cluttered’. OpenCL state is not explicitly passed through the API, which enables the library to be forward compatible when users are ready to switch from OpenCL 1.2 to OpenCL 2.0. Lastly, we designed the API’s such that users control where input and output buffers live. You also have absolute control over when data transfers to/from device memory need to happen, so that there are no performance surprises.
You can leave general feedback about clSPARSE on this blog. For issues or specific feedback and suggestions, please use the Github issues tracker for this project.