DPNP C++ backend kernel library 0.18.0dev0
Data Parallel Extension for NumPy*
Loading...
Searching...
No Matches
types_matrix.hpp
1//*****************************************************************************
2// Copyright (c) 2024-2025, Intel Corporation
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are met:
7// - Redistributions of source code must retain the above copyright notice,
8// this list of conditions and the following disclaimer.
9// - Redistributions in binary form must reproduce the above copyright notice,
10// this list of conditions and the following disclaimer in the documentation
11// and/or other materials provided with the distribution.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
17// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23// THE POSSIBILITY OF SUCH DAMAGE.
24//*****************************************************************************
25
26#pragma once
27
28#include <type_traits>
29
30// dpctl tensor headers
31#include "utils/type_dispatch.hpp"
32
33// dpctl namespace for operations with types
34namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
35
36namespace dpnp::extensions::blas::types
37{
45template <typename T>
47{
48 static constexpr bool is_defined = std::disjunction<
49 dpctl_td_ns::TypePairDefinedEntry<T, float, T, float>,
50 dpctl_td_ns::TypePairDefinedEntry<T, double, T, double>,
51 // fall-through
52 dpctl_td_ns::NotDefinedEntry>::is_defined;
53};
54
62template <typename T>
64{
65 static constexpr bool is_defined = std::disjunction<
66 dpctl_td_ns::TypePairDefinedEntry<T,
67 std::complex<float>,
68 T,
69 std::complex<float>>,
70 dpctl_td_ns::TypePairDefinedEntry<T,
71 std::complex<double>,
72 T,
73 std::complex<double>>,
74 // fall-through
75 dpctl_td_ns::NotDefinedEntry>::is_defined;
76};
77
85template <typename T>
87{
88 static constexpr bool is_defined = std::disjunction<
89 dpctl_td_ns::TypePairDefinedEntry<T,
90 std::complex<float>,
91 T,
92 std::complex<float>>,
93 dpctl_td_ns::TypePairDefinedEntry<T,
94 std::complex<double>,
95 T,
96 std::complex<double>>,
97 // fall-through
98 dpctl_td_ns::NotDefinedEntry>::is_defined;
99};
100
109template <typename Tab, typename Tc>
111{
112 static constexpr bool is_defined = std::disjunction<
113#if !defined(USE_ONEMKL_INTERFACES)
114 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, std::int32_t>,
115 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, float>,
116#endif // USE_ONEMKL_INTERFACES
117 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, float>,
118 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, sycl::half>,
119 dpctl_td_ns::TypePairDefinedEntry<Tab, float, Tc, float>,
120 dpctl_td_ns::TypePairDefinedEntry<Tab, double, Tc, double>,
121 dpctl_td_ns::TypePairDefinedEntry<Tab,
122 std::complex<float>,
123 Tc,
124 std::complex<float>>,
125 dpctl_td_ns::TypePairDefinedEntry<Tab,
126 std::complex<double>,
127 Tc,
128 std::complex<double>>,
129 // fall-through
130 dpctl_td_ns::NotDefinedEntry>::is_defined;
131};
132
141template <typename Tab, typename Tc>
143{
144 static constexpr bool is_defined = std::disjunction<
145#if !defined(USE_ONEMKL_INTERFACES)
146 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, std::int32_t>,
147 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, float>,
148#endif // USE_ONEMKL_INTERFACES
149 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, float>,
150 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, sycl::half>,
151 dpctl_td_ns::TypePairDefinedEntry<Tab, float, Tc, float>,
152 dpctl_td_ns::TypePairDefinedEntry<Tab, double, Tc, double>,
153 dpctl_td_ns::TypePairDefinedEntry<Tab,
154 std::complex<float>,
155 Tc,
156 std::complex<float>>,
157 dpctl_td_ns::TypePairDefinedEntry<Tab,
158 std::complex<double>,
159 Tc,
160 std::complex<double>>,
161 // fall-through
162 dpctl_td_ns::NotDefinedEntry>::is_defined;
163};
164
172template <typename T>
174{
175 static constexpr bool is_defined = std::disjunction<
176 dpctl_td_ns::TypePairDefinedEntry<T, float, T, float>,
177 dpctl_td_ns::TypePairDefinedEntry<T, double, T, double>,
178 dpctl_td_ns::TypePairDefinedEntry<T,
179 std::complex<float>,
180 T,
181 std::complex<float>>,
182 dpctl_td_ns::TypePairDefinedEntry<T,
183 std::complex<double>,
184 T,
185 std::complex<double>>,
186 // fall-through
187 dpctl_td_ns::NotDefinedEntry>::is_defined;
188};
189} // namespace dpnp::extensions::blas::types
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...