Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BLAS][portBLAS] Update interface call for rotmg for portBLAS backend #545

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/blas/backends/portblas/portblas_level1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ void rotm(sycl::queue &queue, std::int64_t n, sycl::buffer<real_t, 1> &x, std::i

void rotmg(sycl::queue &queue, sycl::buffer<real_t, 1> &d1, sycl::buffer<real_t, 1> &d2,
sycl::buffer<real_t, 1> &x1, real_t y1, sycl::buffer<real_t, 1> &param) {
sycl::buffer<real_t, 1> y1_buffer(&y1, sycl::range<1>{ 1 });
CALL_PORTBLAS_FN(::blas::_rotmg, queue, d1, d2, x1, y1_buffer, param);
CALL_PORTBLAS_FN(::blas::_rotmg, queue, d1, d2, x1, y1, param);
}

void scal(sycl::queue &queue, std::int64_t n, real_t alpha, sycl::buffer<real_t, 1> &x,
Expand Down Expand Up @@ -368,18 +367,7 @@ sycl::event rotm(sycl::queue &queue, std::int64_t n, real_t *x, std::int64_t inc

sycl::event rotmg(sycl::queue &queue, real_t *d1, real_t *d2, real_t *x1, real_t y1, real_t *param,
const std::vector<sycl::event> &dependencies) {
auto y_d =
(real_t *)sycl::malloc_device(sizeof(real_t), queue.get_device(), queue.get_context());
auto copy_in_event = queue.memcpy(y_d, &y1, sizeof(real_t), dependencies);
auto rotmg_event = std::invoke([&]() -> sycl::event {
CALL_PORTBLAS_USM_FN(::blas::_rotmg, queue, d1, d2, x1, y_d, param,
std::vector<sycl::event>{ copy_in_event });
});
auto free_event = queue.submit([&](sycl::handler &cgh) {
cgh.depends_on(rotmg_event);
cgh.host_task([=]() { sycl::free(y_d, queue); });
});
return free_event;
CALL_PORTBLAS_USM_FN(::blas::_rotmg, queue, d1, d2, x1, y1, param, dependencies);
}

sycl::event scal(sycl::queue &queue, std::int64_t n, real_t alpha, real_t *x, std::int64_t incx,
Expand Down
Loading