kokkos / stdBLAS

Reference Implementation for stdBLAS
Other
118 stars 22 forks source link

Adding HPX backend #235

Open hkaiser opened 2 years ago

hkaiser commented 2 years ago

This is a very rudimentary implementation of an HPX backend, essentially mostly a proof of concept.

Implemented functions:

The HPX backend will be triggered if one of the HPX execution policies is passed to one of the API functions, e.g.

        std::vector<double> data(N);

        // Requires CTAD working, GCC 11.1 works but some others are buggy
        // std::experimental::mdspan a(data.data(),N);
        std::experimental::mdspan<double,
            std::experimental::extents<std::experimental::dynamic_extent>>
            a(data.data(), N);
        for (std::size_t i = 0; i < a.extent(0); i++)
            a(i) = double(i);

        // This forwards to HPXKernels
        std::experimental::linalg::scale(HPXKernelsSTD::hpx_exec<>(), 2.0, a);
        // This forwards to HPXKernels if LINALG_ENABLE_HPX_DEFAULT is ON
        std::experimental::linalg::scale(std::execution::par, 2.0, a);
        // This always forwards to HPXKernels
        std::experimental::linalg::scale(hpx::execution::par, 2.0, a);
        // This goes to the base implementation
        std::experimental::linalg::scale(std::execution::seq, 2.0, a);
        // This also goes to the base implementation
        std::experimental::linalg::scale(hpx::execution::seq, 2.0, a);

This also contains the necessary build system and testing infrastructure. I'm creating this PR mainly to be able to set up a github action that would run the tests using the HPX backend.

hkaiser commented 2 years ago

@mhoemmen could you possibly approve the GitHub action execution for this PR? This would enable me to set up the HPX testing environment.