DPNP C++ backend kernel library 0.20.0dev0
Data Parallel Extension for NumPy*
Loading...
Searching...
No Matches
types_matrix.hpp
1//*****************************************************************************
2// Copyright (c) 2024, 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// - Neither the name of the copyright holder nor the names of its contributors
13// may be used to endorse or promote products derived from this software
14// without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26// THE POSSIBILITY OF SUCH DAMAGE.
27//*****************************************************************************
28
29#pragma once
30
31#include <type_traits>
32
33// dpctl tensor headers
34#include "utils/type_dispatch.hpp"
35
36// dpctl namespace for operations with types
37namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
38
39namespace dpnp::extensions::blas::types
40{
48template <typename T>
50{
51 static constexpr bool is_defined = std::disjunction<
52 dpctl_td_ns::TypePairDefinedEntry<T, float, T, float>,
53 dpctl_td_ns::TypePairDefinedEntry<T, double, T, double>,
54 // fall-through
55 dpctl_td_ns::NotDefinedEntry>::is_defined;
56};
57
65template <typename T>
67{
68 static constexpr bool is_defined = std::disjunction<
69 dpctl_td_ns::TypePairDefinedEntry<T,
70 std::complex<float>,
71 T,
72 std::complex<float>>,
73 dpctl_td_ns::TypePairDefinedEntry<T,
74 std::complex<double>,
75 T,
76 std::complex<double>>,
77 // fall-through
78 dpctl_td_ns::NotDefinedEntry>::is_defined;
79};
80
88template <typename T>
90{
91 static constexpr bool is_defined = std::disjunction<
92 dpctl_td_ns::TypePairDefinedEntry<T,
93 std::complex<float>,
94 T,
95 std::complex<float>>,
96 dpctl_td_ns::TypePairDefinedEntry<T,
97 std::complex<double>,
98 T,
99 std::complex<double>>,
100 // fall-through
101 dpctl_td_ns::NotDefinedEntry>::is_defined;
102};
103
112template <typename Tab, typename Tc>
114{
115 static constexpr bool is_defined = std::disjunction<
116#if !defined(USE_ONEMATH)
117 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, std::int32_t>,
118 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, float>,
119#endif // USE_ONEMATH
120 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, float>,
121 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, sycl::half>,
122 dpctl_td_ns::TypePairDefinedEntry<Tab, float, Tc, float>,
123 dpctl_td_ns::TypePairDefinedEntry<Tab, double, Tc, double>,
124 dpctl_td_ns::TypePairDefinedEntry<Tab,
125 std::complex<float>,
126 Tc,
127 std::complex<float>>,
128 dpctl_td_ns::TypePairDefinedEntry<Tab,
129 std::complex<double>,
130 Tc,
131 std::complex<double>>,
132 // fall-through
133 dpctl_td_ns::NotDefinedEntry>::is_defined;
134};
135
144template <typename Tab, typename Tc>
146{
147 static constexpr bool is_defined = std::disjunction<
148#if !defined(USE_ONEMATH)
149 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, std::int32_t>,
150 dpctl_td_ns::TypePairDefinedEntry<Tab, std::int8_t, Tc, float>,
151#endif // USE_ONEMATH
152 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, float>,
153 dpctl_td_ns::TypePairDefinedEntry<Tab, sycl::half, Tc, sycl::half>,
154 dpctl_td_ns::TypePairDefinedEntry<Tab, float, Tc, float>,
155 dpctl_td_ns::TypePairDefinedEntry<Tab, double, Tc, double>,
156 dpctl_td_ns::TypePairDefinedEntry<Tab,
157 std::complex<float>,
158 Tc,
159 std::complex<float>>,
160 dpctl_td_ns::TypePairDefinedEntry<Tab,
161 std::complex<double>,
162 Tc,
163 std::complex<double>>,
164 // fall-through
165 dpctl_td_ns::NotDefinedEntry>::is_defined;
166};
167
175template <typename T>
177{
178 static constexpr bool is_defined = std::disjunction<
179 dpctl_td_ns::TypePairDefinedEntry<T, float, T, float>,
180 dpctl_td_ns::TypePairDefinedEntry<T, double, T, double>,
181 dpctl_td_ns::TypePairDefinedEntry<T,
182 std::complex<float>,
183 T,
184 std::complex<float>>,
185 dpctl_td_ns::TypePairDefinedEntry<T,
186 std::complex<double>,
187 T,
188 std::complex<double>>,
189 // fall-through
190 dpctl_td_ns::NotDefinedEntry>::is_defined;
191};
192
200template <typename T>
202{
203 static constexpr bool is_defined = std::disjunction<
204 dpctl_td_ns::TypePairDefinedEntry<T, float, T, float>,
205 dpctl_td_ns::TypePairDefinedEntry<T, double, T, double>,
206 dpctl_td_ns::TypePairDefinedEntry<T,
207 std::complex<float>,
208 T,
209 std::complex<float>>,
210 dpctl_td_ns::TypePairDefinedEntry<T,
211 std::complex<double>,
212 T,
213 std::complex<double>>,
214 // fall-through
215 dpctl_td_ns::NotDefinedEntry>::is_defined;
216};
217} // 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...
A factory to define pairs of supported types for which MKL BLAS library provides support in oneapi::m...