Phylanx Seminar: Revealing the Magic of Blaze

Over the past several weeks, many team members have been asking how aspects of the Phylanx project are implemented. In this seminar,  Hartmut explains the techniques used by Blaze to optimize matrix operations. He implements a matrix addition example which uses types, templates, and curiously recurring template patterns (CRTP) to reduce the number of temporaries made during the execution of the code. By avoiding these extra allocations in a compiler friendly way, Blaze can drastically reduce the amount of time it takes perform matrix operations. You can find links to the seminar materials below:

Seminar Video: https://www.youtube.com/watch?v=F5E8cOqHmRU
Naive Matrix Implementation: http://stellar.cct.lsu.edu/files/phylanx_seminars/03.21.18_seminar_blaze_magic/naive_matrix_03.21.18.cpp
Optimized Matrix Implementation: http://stellar.cct.lsu.edu/files/phylanx_seminars/03.21.18_seminar_blaze_magic/optimized_matrix_03.21.18.cpp

Introduction to Phylanx Coding

In this post I’ll go through the simple implementation of LRA (Logistic Regression Algorithm) to outline the Phylanx architecture and also demonstrate how one might go about writing their own programs in Phylanx. The complete version of the code discussed in this post can be found in the project’s GitHub repository under examples/algorithms directory and the corresponding dataset can be found here. Continue reading