exceptionmatrix-multiplicationarrayfire

ArrayFire's matrix multiplication with integer inputs


I want to perform matrix by vector multiplication but on arrays with integer types to avoid extra conversion (it works fine when both sides are of type f32);

Such operation throws bad type exception for integer types, is there any workaround?


Solution

  • ArrayFire implements matrix multiplication on top of existing BLAS implementations such as cuBLAS, clBLAS, CLBlast, FFTW3, Intel MKL etc. depending on the backend. As far as I am aware, BLAS API doesn't support integer types and therefore no support for integer type on any downstream projects. We haven't had any requests for integer support for matmul on our project page so far. You are welcome to raise a request.

    As a work around, you can call array::as(f32) method on your arrayfire arrays before passing to matmul function.