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