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 dotc_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 dotc_event;
62 mkl_blas::column_major::dotc(exec_q,
70 }
catch (oneapi::mkl::exception
const &e) {
72 <<
"Unexpected MKL exception caught during dotc() call:\nreason: "
74 is_exception_caught =
true;
75 }
catch (sycl::exception
const &e) {
76 error_msg <<
"Unexpected SYCL exception caught during dotc() call:\n"
78 is_exception_caught =
true;
81 if (is_exception_caught)
83 throw std::runtime_error(error_msg.str());
89template <
typename fnT,
typename varT>
95 return dotc_impl<varT>;
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...