Skip to content

Ashar's Proposal

Ashar edited this page May 12, 2020 · 2 revisions

Absract

This proposal aims at three major things, improving the Boost.uBLAS interfaces that were added in GSOC 2019 work, stabilizing, enhancing the unit testing and C++20-ification of the library with the new concept and better constexpr support.

Proposal

The complete proposal is divided into three separate sections. Each of them corresponds to work in a phase of Google Summer of Code. There is some extra optional work that can be done in addition to all presented below. The priority of each of them is in decreasing order.

Stabilizing and Improving the Code Quality

Code Coverage of the Boost.uBLAS library as a whole is only 65%, this gives low confidence to the user about the testing of the library. Last year we improved upon the coverage for the tensor module of uBLAS but because our scope of proposal was limited to the tensor and improving code coverage was an optional work we were not able to improve coverage from uBLAS tests. This year we plan to extend the scope of coverage to the whole uBLAS yet still focusing more on the tensor side. An interesting feature to note here is that while most of the code in the source is reached in the unit tests, it is the branching that is partially reached. This indeed is a hard work to achieve and may take some more time but after the end of GSOC period, I wish to bring the coverage of the whole uBLAS to at least 80%

CI Improvements is another major area of improvement for the library’s development in general. Currently, CI tests the compilation of various tests and examples only on Appveyor(Windows) and Travis(Linux), completely ignoring the AppleClang compilers. It is highly unlikely that things won’t compile on Mac if it compiles on Linux and Windows, but since Apple Clang is in itself a compiler vendor it is very important we test on all OS with our CI. In General, I also don’t like the idea of having different CI platforms for each OS like Appveyor for Windows and Travis for Linux, while Travis supports all 3 OSes. It will be very good if we migrate all three OS compilations on Travis or some other platform like Github actions. Having all builds at one place makes the development and debugging compilation errors a piece of cake. We also need to check the compilation on both clang and GCC in Linux, if possible different versions of them as well. Of all the Boost Libraries, I found uBLAS to be least thoroughly checked on Linux. Such loose CI opens up a huge window for compilation issues on different users or machines.

Matrices and Vectors as Extensions of Tensor

uBLAS already has boost::numeric::ublas::matrix and boost::numeric::ublas::vector. Cem worked on bringing the support for boost::numeric::ublas::tensor, later in following years I and another student worked on boost::numeric::ublas::tensor and improved and enhanced the library with new expression templates, new interfaces and many other improvements. The newly added Tensor support in uBLAS was targeting C++17 that is bound to bring in many new improvements and performances that come with later language versions. We now believe that the Tensor Extension is ready and could be extended to bring in new types that are based on boost::numeric::ublas::tensor, we call the new types boost::numeric::ublas::matrix2 and boost::numeric::vector2. We can make the old types deprecated and after making these new types exactly like the old API. So that user can migrate quickly to the new types. It will also make the development easier as there will be one unified ET, codebase and other things. Let’s get into the implementation details now.

Adding C++20 Concepts

C++ Concepts adds type checking to template programming, any template heavy library should be using concepts. Most of the recent compilers like GCC10, clang10, and MSVC19.23 have full support for concepts. There are so many benefits of having Concepts in uBLAS, each of them is mentioned in the next page.

Improving GSOC2019 and Unit test improvements

GSOC2019 was a great year for uBLAS, So many new great things were added to uBLAS but some of them need some improvement and better integration with the current tensor. With Amit’s work we got sub tensors, static_extents and slices, they all are ready but need integration testing. In the following section, we present the idea of creating a Matrix and Vector that is based on a tensor class and it is important to extend the sub tensor to form new types like submatrix or subvector. Creation of such new types will be purely a type-alias since there is nothing special in tensor and matrix when it comes to view except the extent size.