Skip to content

Could current ArrayFire support Matrix-Multply in batch mode? #1996

@BookmanHan

Description

@BookmanHan

Hi, I have read some issues of batched MM.
I think this may be featured in latest version 3.5.1, because this page (http://arrayfire.org/docs/page_gfor.htm) illustrates an usage of gfor-MM.

But, I can't apply a batched-MM as below.

        gfor(af::seq i, n_sample)
        {
            af::array i_left = arr_left(af::span, af::span, i);
            af::array i_right = arr_right(af::span, af::span, i);
            arr(af::span, af::span, i) = af::matmul(i_left, i_right);
        }

What should I do?

On the other hand, ArrayFire could not work with OpenMP as below.

#pragma omp parallel for
        for(auto i=0; i<n_sample, ++i)
        {
            af::array i_left = arr_left(af::span, af::span, i);
            af::array i_right = arr_right(af::span, af::span, i);
            arr(af::span, af::span, i) = af::matmul(i_left, i_right);
        }

It came up with an exception in af::gen_assign.
Could this be fixed?

Thanks, a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions