30#include "dot_common.hpp"
32namespace dpnp::extensions::blas
34namespace mkl_blas = oneapi::mkl::blas;
35namespace type_utils = dpctl::tensor::type_utils;
38static sycl::event dot_impl(sycl::queue &exec_q,
41 const std::int64_t incx,
43 const std::int64_t incy,
45 const std::vector<sycl::event> &depends)
47 type_utils::validate_type_for_device<T>(exec_q);
49 const T *x =
reinterpret_cast<const T *
>(vectorX);
50 const T *y =
reinterpret_cast<const T *
>(vectorY);
51 T *res =
reinterpret_cast<T *
>(result);
53 std::stringstream error_msg;
54 bool is_exception_caught =
false;
56 sycl::event dot_event;
58 dot_event = mkl_blas::column_major::dot(exec_q,
66 }
catch (oneapi::mkl::exception
const &e) {
68 <<
"Unexpected MKL exception caught during dot() call:\nreason: "
70 is_exception_caught =
true;
71 }
catch (sycl::exception
const &e) {
72 error_msg <<
"Unexpected SYCL exception caught during dot() call:\n"
74 is_exception_caught =
true;
77 if (is_exception_caught)
79 throw std::runtime_error(error_msg.str());
85template <
typename fnT,
typename varT>
91 return dot_impl<varT>;
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...