33#include "dot_common.hpp"
35namespace dpnp::extensions::blas
37namespace mkl_blas = oneapi::mkl::blas;
38namespace type_utils = dpctl::tensor::type_utils;
41static sycl::event dot_impl(sycl::queue &exec_q,
44 const std::int64_t incx,
46 const std::int64_t incy,
48 const std::vector<sycl::event> &depends)
50 type_utils::validate_type_for_device<T>(exec_q);
52 const T *x =
reinterpret_cast<const T *
>(vectorX);
53 const T *y =
reinterpret_cast<const T *
>(vectorY);
54 T *res =
reinterpret_cast<T *
>(result);
56 std::stringstream error_msg;
57 bool is_exception_caught =
false;
59 sycl::event dot_event;
61 dot_event = mkl_blas::column_major::dot(exec_q,
69 }
catch (oneapi::mkl::exception
const &e) {
71 <<
"Unexpected MKL exception caught during dot() call:\nreason: "
73 is_exception_caught =
true;
74 }
catch (sycl::exception
const &e) {
75 error_msg <<
"Unexpected SYCL exception caught during dot() call:\n"
77 is_exception_caught =
true;
80 if (is_exception_caught)
82 throw std::runtime_error(error_msg.str());
88template <
typename fnT,
typename varT>
94 return dot_impl<varT>;
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...