33#include <pybind11/pybind11.h>
35#include "dot_common.hpp"
37namespace dpnp::extensions::blas
39namespace mkl_blas = oneapi::mkl::blas;
40namespace type_utils = dpnp::tensor::type_utils;
41namespace py = pybind11;
44static sycl::event dotu_impl(sycl::queue &exec_q,
47 const std::int64_t incx,
49 const std::int64_t incy,
51 const std::vector<sycl::event> &depends)
53 type_utils::validate_type_for_device<T>(exec_q);
55 const T *x =
reinterpret_cast<const T *
>(vectorX);
56 const T *y =
reinterpret_cast<const T *
>(vectorY);
57 T *res =
reinterpret_cast<T *
>(result);
59 std::stringstream error_msg;
60 bool is_exception_caught =
false;
62 sycl::event dotu_event;
66 py::gil_scoped_release lock{};
69 mkl_blas::column_major::dotu(exec_q,
77 }
catch (oneapi::mkl::exception
const &e) {
79 <<
"Unexpected MKL exception caught during dotu() call:\nreason: "
81 is_exception_caught =
true;
82 }
catch (sycl::exception
const &e) {
83 error_msg <<
"Unexpected SYCL exception caught during dotu() call:\n"
85 is_exception_caught =
true;
88 if (is_exception_caught)
90 throw std::runtime_error(error_msg.str());
96template <
typename fnT,
typename varT>
102 return dotu_impl<varT>;
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...