DPNP C++ backend kernel library 0.21.0dev0
Data Parallel Extension for NumPy*
Loading...
Searching...
No Matches
types_matrix.hpp
1//*****************************************************************************
2// Copyright (c) 2023, 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// dpnp tensor headers
34#include "utils/type_dispatch.hpp"
35
36// namespace for operations with types
37namespace dpnp_td_ns = dpnp::tensor::type_dispatch;
38
39namespace dpnp::extensions::lapack::types
40{
51template <typename T>
53{
54 static constexpr bool is_defined =
55 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
56 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
57 dpnp_td_ns::TypePairDefinedEntry<T,
58 std::complex<float>,
59 T,
60 std::complex<float>>,
61 dpnp_td_ns::TypePairDefinedEntry<T,
62 std::complex<double>,
63 T,
64 std::complex<double>>,
65 // fall-through
66 dpnp_td_ns::NotDefinedEntry>::is_defined;
67};
68
78template <typename T>
80{
81 static constexpr bool is_defined =
82 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
83 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
84 dpnp_td_ns::TypePairDefinedEntry<T,
85 std::complex<float>,
86 T,
87 std::complex<float>>,
88 dpnp_td_ns::TypePairDefinedEntry<T,
89 std::complex<double>,
90 T,
91 std::complex<double>>,
92 // fall-through
93 dpnp_td_ns::NotDefinedEntry>::is_defined;
94};
95
105template <typename T>
107{
108 static constexpr bool is_defined =
109 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
110 dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
111 dpnp_td_ns::TypePairDefinedEntry<T,
112 std::complex<float>,
113 T,
114 std::complex<float>>,
115 dpnp_td_ns::TypePairDefinedEntry<T,
116 std::complex<double>,
117 T,
118 std::complex<double>>,
119 // fall-through
120 dpnp_td_ns::NotDefinedEntry>::is_defined;
121};
122
132template <typename T, typename RealT>
134{
135 static constexpr bool is_defined = std::disjunction<
136 dpnp_td_ns::TypePairDefinedEntry<T, float, RealT, float>,
137 dpnp_td_ns::TypePairDefinedEntry<T, double, RealT, double>,
138 dpnp_td_ns::TypePairDefinedEntry<T, std::complex<float>, RealT, float>,
139 dpnp_td_ns::
140 TypePairDefinedEntry<T, std::complex<double>, RealT, double>,
141 // fall-through
142 dpnp_td_ns::NotDefinedEntry>::is_defined;
143};
144
153template <typename T>
155{
156 static constexpr bool is_defined =
157 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
158 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
159 dpnp_td_ns::TypePairDefinedEntry<T,
160 std::complex<float>,
161 T,
162 std::complex<float>>,
163 dpnp_td_ns::TypePairDefinedEntry<T,
164 std::complex<double>,
165 T,
166 std::complex<double>>,
167 // fall-through
168 dpnp_td_ns::NotDefinedEntry>::is_defined;
169};
170
179template <typename T>
181{
182 static constexpr bool is_defined =
183 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
184 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
185 dpnp_td_ns::TypePairDefinedEntry<T,
186 std::complex<float>,
187 T,
188 std::complex<float>>,
189 dpnp_td_ns::TypePairDefinedEntry<T,
190 std::complex<double>,
191 T,
192 std::complex<double>>,
193 // fall-through
194 dpnp_td_ns::NotDefinedEntry>::is_defined;
195};
196
205template <typename T>
207{
208 static constexpr bool is_defined =
209 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
210 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
211 dpnp_td_ns::TypePairDefinedEntry<T,
212 std::complex<float>,
213 T,
214 std::complex<float>>,
215 dpnp_td_ns::TypePairDefinedEntry<T,
216 std::complex<double>,
217 T,
218 std::complex<double>>,
219 // fall-through
220 dpnp_td_ns::NotDefinedEntry>::is_defined;
221};
222
233template <typename T>
235{
236 static constexpr bool is_defined =
237 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
238 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
239 dpnp_td_ns::TypePairDefinedEntry<T,
240 std::complex<float>,
241 T,
242 std::complex<float>>,
243 dpnp_td_ns::TypePairDefinedEntry<T,
244 std::complex<double>,
245 T,
246 std::complex<double>>,
247 // fall-through
248 dpnp_td_ns::NotDefinedEntry>::is_defined;
249};
250
261template <typename T>
263{
264 static constexpr bool is_defined =
265 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
266 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
267 dpnp_td_ns::TypePairDefinedEntry<T,
268 std::complex<float>,
269 T,
270 std::complex<float>>,
271 dpnp_td_ns::TypePairDefinedEntry<T,
272 std::complex<double>,
273 T,
274 std::complex<double>>,
275 // fall-through
276 dpnp_td_ns::NotDefinedEntry>::is_defined;
277};
278
288template <typename T, typename RealT>
290{
291 static constexpr bool is_defined = std::disjunction<
292 dpnp_td_ns::
293 TypePairDefinedEntry<T, std::complex<double>, RealT, double>,
294 dpnp_td_ns::TypePairDefinedEntry<T, std::complex<float>, RealT, float>,
295 // fall-through
296 dpnp_td_ns::NotDefinedEntry>::is_defined;
297};
298
310template <typename T>
312{
313 static constexpr bool is_defined =
314 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
315 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
316 // fall-through
317 dpnp_td_ns::NotDefinedEntry>::is_defined;
318};
319
329template <typename T>
331{
332 static constexpr bool is_defined =
333 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
334 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
335 // fall-through
336 dpnp_td_ns::NotDefinedEntry>::is_defined;
337};
338
347template <typename T>
349{
350 static constexpr bool is_defined =
351 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
352 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
353 dpnp_td_ns::TypePairDefinedEntry<T,
354 std::complex<float>,
355 T,
356 std::complex<float>>,
357 dpnp_td_ns::TypePairDefinedEntry<T,
358 std::complex<double>,
359 T,
360 std::complex<double>>,
361 // fall-through
362 dpnp_td_ns::NotDefinedEntry>::is_defined;
363};
364
373template <typename T>
375{
376 static constexpr bool is_defined =
377 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T, double, T, double>,
378 dpnp_td_ns::TypePairDefinedEntry<T, float, T, float>,
379 dpnp_td_ns::TypePairDefinedEntry<T,
380 std::complex<float>,
381 T,
382 std::complex<float>>,
383 dpnp_td_ns::TypePairDefinedEntry<T,
384 std::complex<double>,
385 T,
386 std::complex<double>>,
387 // fall-through
388 dpnp_td_ns::NotDefinedEntry>::is_defined;
389};
390
399template <typename T, typename RealT>
401{
402 static constexpr bool is_defined = std::disjunction<
403 dpnp_td_ns::TypePairDefinedEntry<T, double, RealT, double>,
404 dpnp_td_ns::TypePairDefinedEntry<T, float, RealT, float>,
405 // fall-through
406 dpnp_td_ns::NotDefinedEntry>::is_defined;
407};
408
420template <typename T>
422{
423 static constexpr bool is_defined =
424 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T,
425 std::complex<float>,
426 T,
427 std::complex<float>>,
428 dpnp_td_ns::TypePairDefinedEntry<T,
429 std::complex<double>,
430 T,
431 std::complex<double>>,
432 // fall-through
433 dpnp_td_ns::NotDefinedEntry>::is_defined;
434};
435
445template <typename T>
447{
448 static constexpr bool is_defined =
449 std::disjunction<dpnp_td_ns::TypePairDefinedEntry<T,
450 std::complex<float>,
451 T,
452 std::complex<float>>,
453 dpnp_td_ns::TypePairDefinedEntry<T,
454 std::complex<double>,
455 T,
456 std::complex<double>>,
457 // fall-through
458 dpnp_td_ns::NotDefinedEntry>::is_defined;
459};
460} // namespace dpnp::extensions::lapack::types
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...
A factory to define pairs of supported types for which MKL LAPACK library provides support in oneapi:...