samedi 22 août 2020

How can BLAS library be directly used with boost multiarrays?

Given two matrices A and B, and C for the result of their multiplication.

#include "boost/multi_array.hpp"
typedef boost::multi_array<double, 2> matrix;
int m=5;
int n=6;
int k=7;

matrix A(boost::extents[m][k]);
matrix B(boost::extents[k][n]);
matrix C(boost::extents[m][n]);

How can dgemm function from the blas library be called to compute matrix product of A and B? I am aware of the uBLAS part boost library, armadillo, MTL 4, eigen and some other libraries that provide convenient wrappers for blas functions. The question here is how to directly call dgemm on the multi-arrays.

Aucun commentaire:

Enregistrer un commentaire