SYCL-BLAS: Leveraging Expression Trees for Linear Algebra

In the current landscape of C++ applications, there is an increasing need of including different levels of support for heterogeneous platforms, where multiple specialised devices collaborate to execute an application. In this context, the SYCL standard[8] has been published by Khronos, providing a C++ abstraction layer on top of OpenCL[9] that enables single-source programming for a large number of heterogeneous devices. SYCL single-source programming and task data-flow approach enable developers to leverage modern programming techniques on heterogeneous platforms. In this paper, we present SYCL-BLAS, a BLAS implementation using SYCL that uses Expression Tree templates to generate BLAS kernels. This technique is then used to demonstrate seamless kernel fusion via composition of tree nodes. We also demonstrate how SYCL can be used to quickly develop libraries for heterogeneous systems by providing sufficient levels of abstraction.