Skip to content
Cem Bassoy edited this page Apr 5, 2021 · 35 revisions

Adding tensor support to Boost::uBLAS

This wiki describes the Boost's 2018 GSoC project: adding tensor support to Boost's uBLAS


General

Boost​

Boost is a collection of free, peer-reviewed C++ libraries, see here. We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use.

Boost.uBlas

Boost.uBLAS (aka Basic Linear Algebra Subroutines), is part of collection of the Boost C++ Libraries and provides BLAS level 1, 2, 3 functionality for dense, packed and sparse matrices, see here. The design and implementation unify mathematical notation via operator overloading and efficient code generation via expression templates.

Google Summer of Code (GSoC)

Google Summer of Code is a global program focused on bringing more student developers into open source software development. More information can be found here. A project description on the GSoC site can be found here.


Project

Proposal

The initial GSoC 2018 project proposal from Boost.uBLAS is to add tensors to the uBLAS library. The proposal can be found here. My project proposal for Boost and GSoC can be found here.

Mentors

My mentors were David Bellot and Stefan Seefeld.

Milestones and Tasks

According to my project proposal, I have defined seven milestones each of which are two weeks heavy. Every milestone contains several issues or tasks. All milestones and thus issues are completed. A complete list of all completed issues is provided witin the kanban board done column.

  1. Community Bonding with completed tasks.
  2. Tensor Template Class with completed tasks
  3. Interoperability with completed tasks
  4. Expression Templates with completed tasks
  5. Tensor Contraction with completed tasks
  6. Einstein Notation with completed tasks
  7. Documentation with the completed tasks

Proposals for uBLAS

Important discussion topics and proposals for uBLAS can be found on the kanban board proposals column.

Future Work for uBLAS.Tensor project

Future work for this tensor extentsion of uBLAS can be found on the kanban board future work column.


Implementation

Branch

All the branch information during the whole process of GSoC 2018, including issues, milestones and the kanban board are in the branch tensor that is a fork of uBLAS and for which this wiki is written for. My total contribution (number of total commits, etc.) can be viewed here.

Commit List

The commit list can be found here.

Source Code

Source code of the tensor extension is placed within the tensor folder. However, all necessary header files are included in the file tensor.hpp.

Modifications

With only few exceptions, the original code of the uBLAS's development branch has not been modified. Details about implementation and design differing from the development branch is given here.

Documentation

An overview of the code is described on the documentation page. Template class and function interfaces are also explained in more detail in HTML format within doc folder.

Unit-Tests

The extension is heavily tested using the latest features of the boost test library where almost all tests are templated for data type template parameter using fixtures for different shape extents. All tests are stored in test/tensor.

Example Code

Example code is placed in the example folder.

Diff Comparison

A diff comparison between the development branch and this tensor branch is given here. The tensor branch can be automatically merged into the development branch.


Acknowledgement

I would like to thank both of my mentors and especially Stefan. We had very open discussions about the design of the tensor extension. I enjoyed it very much.