mkl-devel-dpcpp 2025.0.0__py2.py3-none-manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mkl-devel-dpcpp might be problematic. Click here for more details.

Files changed (82) hide show
  1. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/bfloat16.hpp +26 -0
  2. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/blas/buffer.hpp +42 -0
  3. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/blas/buffer_decls.hpp +880 -0
  4. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/blas/types.hpp +60 -0
  5. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/blas/usm.hpp +42 -0
  6. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/blas/usm_decls.hpp +1240 -0
  7. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/blas.hpp +33 -0
  8. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/dft.hpp +253 -0
  9. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/dfti.hpp +22 -0
  10. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/exceptions.hpp +110 -0
  11. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/experimental/data_fitting/interpolate.hpp +67 -0
  12. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/experimental/data_fitting/spline_and_data_params.hpp +68 -0
  13. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/experimental/data_fitting/splines.hpp +177 -0
  14. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/experimental/data_fitting.hpp +22 -0
  15. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/export.hpp +25 -0
  16. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/lapack/concepts.hpp +55 -0
  17. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/lapack/exceptions.hpp +75 -0
  18. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/lapack/lapack.hpp +1095 -0
  19. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/lapack/scratchpad.hpp +106 -0
  20. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/lapack.hpp +23 -0
  21. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/detail/engine_base.hpp +48 -0
  22. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/bernoulli_impl.hpp +89 -0
  23. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/beta_impl.hpp +464 -0
  24. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/bits_impl.hpp +71 -0
  25. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/distribution_base.hpp +81 -0
  26. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/engine_base.hpp +43 -0
  27. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/engine_helpers_base.hpp +54 -0
  28. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/exponential_impl.hpp +116 -0
  29. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/gamma_impl.hpp +285 -0
  30. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/gaussian_impl.hpp +270 -0
  31. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/lognormal_impl.hpp +105 -0
  32. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/mcg31m1_helpers_impl.hpp +117 -0
  33. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/mcg31m1_impl.hpp +223 -0
  34. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/mcg59_helpers_impl.hpp +118 -0
  35. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/mcg59_impl.hpp +266 -0
  36. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/mrg32k3a_helpers_impl.hpp +125 -0
  37. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/mrg32k3a_impl.hpp +385 -0
  38. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/mrg32k3a_skip_ahead_matrix.hpp +3668 -0
  39. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/philox4x32x10_helpers_impl.hpp +141 -0
  40. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/philox4x32x10_impl.hpp +552 -0
  41. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/poisson_impl.hpp +355 -0
  42. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/types.hpp +58 -0
  43. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/uniform_bits_impl.hpp +51 -0
  44. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/uniform_impl.hpp +289 -0
  45. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/detail/vm_wrappers.hpp +183 -0
  46. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/distributions.hpp +637 -0
  47. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/engine_helpers.hpp +116 -0
  48. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/engines.hpp +187 -0
  49. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/functions.hpp +59 -0
  50. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device/types.hpp +74 -0
  51. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/device.hpp +29 -0
  52. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/distributions.hpp +1913 -0
  53. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/engines.hpp +788 -0
  54. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng/functions.hpp +163 -0
  55. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/rng.hpp +22 -0
  56. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/spblas/sparse_auxiliary.hpp +111 -0
  57. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/spblas/sparse_operations.hpp +446 -0
  58. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/spblas/sparse_structures.hpp +193 -0
  59. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/spblas.hpp +32 -0
  60. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/stats.hpp +356 -0
  61. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/types.hpp +321 -0
  62. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/buffer.hpp +3529 -0
  63. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/decls.hpp +280 -0
  64. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/detail/decls.hpp +81 -0
  65. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/detail/dispatch.hpp +1059 -0
  66. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/detail/ep.hpp +861 -0
  67. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/detail/ha.hpp +860 -0
  68. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/detail/la.hpp +860 -0
  69. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/detail/rts.hpp +4608 -0
  70. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/detail/scalar.hpp +8963 -0
  71. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/device/vm.hpp +460 -0
  72. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/span.hpp +3813 -0
  73. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm/usm.hpp +3581 -0
  74. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl/vm.hpp +30 -0
  75. mkl_devel_dpcpp-2025.0.0.data/data/include/oneapi/mkl.hpp +34 -0
  76. mkl_devel_dpcpp-2025.0.0.data/data/lib/libmkl_sycl.a +0 -0
  77. mkl_devel_dpcpp-2025.0.0.data/data/lib/libmkl_sycl.so +1 -0
  78. mkl_devel_dpcpp-2025.0.0.dist-info/LICENSE.txt +25 -0
  79. mkl_devel_dpcpp-2025.0.0.dist-info/METADATA +24 -0
  80. mkl_devel_dpcpp-2025.0.0.dist-info/RECORD +82 -0
  81. mkl_devel_dpcpp-2025.0.0.dist-info/WHEEL +6 -0
  82. mkl_devel_dpcpp-2025.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,356 @@
1
+ /*******************************************************************************
2
+ * Copyright 2020-2022 Intel Corporation.
3
+ *
4
+ * This software and the related documents are Intel copyrighted materials, and
5
+ * your use of them is governed by the express license under which they were
6
+ * provided to you (License). Unless the License provides otherwise, you may not
7
+ * use, modify, copy, publish, distribute, disclose or transmit this software or
8
+ * the related documents without Intel's prior written permission.
9
+ *
10
+ * This software and the related documents are provided as is, with no express
11
+ * or implied warranties, other than those that are expressly stated in the
12
+ * License.
13
+ *******************************************************************************/
14
+
15
+ #ifndef _STATS_HPP__
16
+ #define _STATS_HPP__
17
+
18
+ #include <type_traits>
19
+ #include <vector>
20
+
21
+ #include <sycl/sycl.hpp>
22
+
23
+ #include "oneapi/mkl/export.hpp"
24
+ #include "oneapi/mkl/exceptions.hpp"
25
+
26
+ namespace oneapi {
27
+ namespace mkl {
28
+ namespace stats {
29
+
30
+ enum class method : std::int64_t {
31
+ fast = 0x00000001,
32
+ one_pass = 0x00000002
33
+ };
34
+
35
+
36
+ enum class layout : std::int64_t {
37
+ row_major = 0x00010000,
38
+ col_major = 0x00020000
39
+ };
40
+
41
+ template<layout ObservationsLayout = layout::row_major, typename Type = float*>
42
+ struct dataset {};
43
+
44
+ // Specialization for USM API
45
+ template<layout ObservationsLayout, typename Type>
46
+ struct dataset<ObservationsLayout, Type*> {
47
+ static_assert(std::is_same<Type, float>::value | std::is_same<Type, double>::value,
48
+ "oneMKL: stats/dataset: template type is not supported");
49
+
50
+ // Constructor
51
+ explicit dataset(std::int64_t n_dims_, std::int64_t n_observations_, Type* observations_,
52
+ Type* weights_ = nullptr, std::int64_t* indices_ = nullptr) :
53
+ n_dims(n_dims_), n_observations(n_observations_), observations(observations_),
54
+ weights(weights_), indices(indices_) {
55
+ if(n_dims_ <= 0) {
56
+ throw oneapi::mkl::invalid_argument("stats", "dataset", "number of dimensions <= 0");
57
+ }
58
+ if(n_observations_ <= 0) {
59
+ throw oneapi::mkl::invalid_argument("stats", "dataset", "number of observations <= 0");
60
+ }
61
+ if(observations_ == nullptr) {
62
+ throw oneapi::mkl::invalid_argument("stats", "dataset", "observations is nullptr");
63
+ }
64
+ };
65
+
66
+ std::int64_t n_dims;
67
+ std::int64_t n_observations;
68
+ Type* observations;
69
+ Type* weights = nullptr;
70
+ std::int64_t* indices = nullptr;
71
+ static constexpr oneapi::mkl::stats::layout layout = ObservationsLayout;
72
+ };
73
+
74
+ // Specialization for buffer-based API
75
+ template<layout ObservationsLayout, typename Type>
76
+ struct dataset<ObservationsLayout, sycl::buffer<Type, 1>> {
77
+ static_assert(std::is_same<Type, float>::value | std::is_same<Type, double>::value,
78
+ "oneMKL: stats/dataset: template type is not supported");
79
+
80
+ // Constructor
81
+ explicit dataset(std::int64_t n_dims_, std::int64_t n_observations_,
82
+ sycl::buffer<Type, 1> observations_, sycl::buffer<Type, 1> weights_ = {0},
83
+ sycl::buffer<std::int64_t, 1> indices_ = {0}) :
84
+ n_dims(n_dims_), n_observations(n_observations_), observations(observations_),
85
+ weights(weights_), indices(indices_) {
86
+ if(n_dims_ <= 0) {
87
+ throw oneapi::mkl::invalid_argument("stats", "dataset", "number of dimensions <= 0");
88
+ }
89
+ if(n_observations_ <= 0) {
90
+ throw oneapi::mkl::invalid_argument("stats", "dataset", "number of observations <= 0");
91
+ }
92
+ if(observations_.size() == 0) {
93
+ throw oneapi::mkl::invalid_argument("stats", "dataset", "observations is empty");
94
+ }
95
+ };
96
+
97
+ std::int64_t n_dims;
98
+ std::int64_t n_observations;
99
+ sycl::buffer<Type, 1> observations;
100
+ sycl::buffer<Type, 1> weights = {0};
101
+ sycl::buffer<std::int64_t, 1> indices = {0};
102
+ static constexpr oneapi::mkl::stats::layout layout = ObservationsLayout;
103
+ };
104
+
105
+ // Helper funtions to make dataset
106
+ template<layout ObservationsLayout = layout::row_major, typename Type>
107
+ dataset<ObservationsLayout, Type*> make_dataset(std::int64_t n_dims, std::int64_t n_observations,
108
+ Type* observations, Type* weights = nullptr,
109
+ std::int64_t* indices = nullptr) {
110
+ return dataset<ObservationsLayout, Type*>(n_dims, n_observations, observations, weights, indices);
111
+ }
112
+
113
+
114
+ template<layout ObservationsLayout = layout::row_major, typename Type>
115
+ dataset<ObservationsLayout, sycl::buffer<Type, 1>> make_dataset(std::int64_t n_dims,
116
+ std::int64_t n_observations,
117
+ sycl::buffer<Type, 1> observations,
118
+ sycl::buffer<Type, 1> weights = {0},
119
+ sycl::buffer<std::int64_t, 1> indices = {0}) {
120
+ return dataset<ObservationsLayout, sycl::buffer<Type, 1>>(n_dims, n_observations,
121
+ observations, weights, indices);
122
+ }
123
+
124
+ // Raw sum computation
125
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
126
+ void raw_sum(sycl::queue& queue,
127
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
128
+ sycl::buffer<Type, 1> sum,
129
+ sycl::buffer<Type, 1> raw_sum_2 = {0},
130
+ sycl::buffer<Type, 1> raw_sum_3 = {0},
131
+ sycl::buffer<Type, 1> raw_sum_4 = {0});
132
+
133
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
134
+ sycl::event raw_sum(sycl::queue& queue,
135
+ const dataset<ObservationsLayout, Type*>& data,
136
+ Type* sum,
137
+ Type* raw_sum_2 = nullptr,
138
+ Type* raw_sum_3 = nullptr,
139
+ Type* raw_sum_4 = nullptr,
140
+ const std::vector<sycl::event> &dependencies = {});
141
+
142
+ // Central sum computation
143
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
144
+ void central_sum(sycl::queue& queue,
145
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
146
+ sycl::buffer<Type, 1> central_sum_2,
147
+ sycl::buffer<Type, 1> central_sum_3 = {0},
148
+ sycl::buffer<Type, 1> central_sum_4 = {0});
149
+
150
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
151
+ sycl::event central_sum(sycl::queue& queue,
152
+ const dataset<ObservationsLayout, Type*>& data,
153
+ Type* central_sum_2,
154
+ Type* central_sum_3 = nullptr,
155
+ Type* central_sum_4 = nullptr,
156
+ const std::vector<sycl::event> &dependencies = {});
157
+
158
+ // Central sum with user mean
159
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
160
+ void central_sum(sycl::queue& queue,
161
+ sycl::buffer<Type, 1> mean,
162
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
163
+ sycl::buffer<Type, 1> central_sum_2,
164
+ sycl::buffer<Type, 1> central_sum_3 = {0},
165
+ sycl::buffer<Type, 1> central_sum_4 = {0});
166
+
167
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
168
+ sycl::event central_sum(sycl::queue& queue,
169
+ Type* mean,
170
+ const dataset<ObservationsLayout, Type*>& data,
171
+ Type* central_sum_2,
172
+ Type* central_sum_3 = nullptr,
173
+ Type* central_sum_4 = nullptr,
174
+ const std::vector<sycl::event> &dependencies = {});
175
+
176
+ // Raw moment
177
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
178
+ void raw_moment(sycl::queue& queue,
179
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
180
+ sycl::buffer<Type, 1> mean,
181
+ sycl::buffer<Type, 1> raw_moment_2 = {0},
182
+ sycl::buffer<Type, 1> raw_moment_3 = {0},
183
+ sycl::buffer<Type, 1> raw_moment_4 = {0});
184
+
185
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
186
+ sycl::event raw_moment(sycl::queue& queue,
187
+ const dataset<ObservationsLayout, Type*>& data,
188
+ Type* mean,
189
+ Type* raw_moment_2 = nullptr,
190
+ Type* raw_moment_3 = nullptr,
191
+ Type* raw_moment_4 = nullptr,
192
+ const std::vector<sycl::event> &dependencies = {});
193
+
194
+ // Central moment computation
195
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
196
+ void central_moment(sycl::queue& queue,
197
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
198
+ sycl::buffer<Type, 1> central_moment_2,
199
+ sycl::buffer<Type, 1> central_moment_3 = {0},
200
+ sycl::buffer<Type, 1> central_moment_4 = {0});
201
+
202
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
203
+ sycl::event central_moment(sycl::queue& queue,
204
+ const dataset<ObservationsLayout, Type*>& data,
205
+ Type* central_moment_2,
206
+ Type* central_moment_3 = nullptr,
207
+ Type* central_moment_4 = nullptr,
208
+ const std::vector<sycl::event> &dependencies = {});
209
+
210
+ // Central moment with user mean
211
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
212
+ void central_moment(sycl::queue& queue,
213
+ sycl::buffer<Type, 1> mean,
214
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
215
+ sycl::buffer<Type, 1> central_moment_2,
216
+ sycl::buffer<Type, 1> central_moment_3 = {0},
217
+ sycl::buffer<Type, 1> central_moment_4 = {0});
218
+
219
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
220
+ sycl::event central_moment(sycl::queue& queue,
221
+ Type* mean,
222
+ const dataset<ObservationsLayout, Type*>& data,
223
+ Type* central_moment_2,
224
+ Type* central_moment_3 = nullptr,
225
+ Type* central_moment_4 = nullptr,
226
+ const std::vector<sycl::event> &dependencies = {});
227
+
228
+ // Mean computation
229
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
230
+ void mean(sycl::queue& queue,
231
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
232
+ sycl::buffer<Type, 1> mean);
233
+
234
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
235
+ sycl::event mean(sycl::queue& queue,
236
+ const dataset<ObservationsLayout, Type*>& data,
237
+ Type* mean,
238
+ const std::vector<sycl::event> &dependencies = {});
239
+
240
+ // Variation computation
241
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
242
+ void variation(sycl::queue& queue,
243
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
244
+ sycl::buffer<Type, 1> variation);
245
+
246
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
247
+ sycl::event variation(sycl::queue& queue,
248
+ const dataset<ObservationsLayout, Type*>& data,
249
+ Type* variation,
250
+ const std::vector<sycl::event> &dependencies = {});
251
+
252
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
253
+ void variation(sycl::queue& queue,
254
+ sycl::buffer<Type, 1> mean,
255
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
256
+ sycl::buffer<Type, 1> variation);
257
+
258
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
259
+ sycl::event variation(sycl::queue& queue,
260
+ Type* mean,
261
+ const dataset<ObservationsLayout, Type*>& data,
262
+ Type* variation,
263
+ const std::vector<sycl::event> &dependencies = {});
264
+
265
+ // Skewness computation
266
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
267
+ void skewness(sycl::queue& queue,
268
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
269
+ sycl::buffer<Type, 1> skewness);
270
+
271
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
272
+ sycl::event skewness(sycl::queue& queue,
273
+ const dataset<ObservationsLayout, Type*>& data,
274
+ Type* skewness,
275
+ const std::vector<sycl::event> &dependencies = {});
276
+
277
+ // Skewness computation for user-defined mean
278
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
279
+ void skewness(sycl::queue& queue,
280
+ sycl::buffer<Type, 1> mean,
281
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
282
+ sycl::buffer<Type, 1> skewness);
283
+
284
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
285
+ sycl::event skewness(sycl::queue& queue,
286
+ Type* mean,
287
+ const dataset<ObservationsLayout, Type*>& data,
288
+ Type* skewness,
289
+ const std::vector<sycl::event> &dependencies = {});
290
+
291
+ // Kurtosis computation
292
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
293
+ void kurtosis(sycl::queue& queue,
294
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
295
+ sycl::buffer<Type, 1> kurtosis);
296
+
297
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
298
+ sycl::event kurtosis(sycl::queue& queue,
299
+ const dataset<ObservationsLayout, Type*>& data,
300
+ Type* kurtosis,
301
+ const std::vector<sycl::event> &dependencies = {});
302
+
303
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
304
+ void kurtosis(sycl::queue& queue,
305
+ sycl::buffer<Type, 1> mean,
306
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
307
+ sycl::buffer<Type, 1> kurtosis);
308
+
309
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
310
+ sycl::event kurtosis(sycl::queue& queue,
311
+ Type* mean,
312
+ const dataset<ObservationsLayout, Type*>& data,
313
+ Type* kurtosis,
314
+ const std::vector<sycl::event> &dependencies = {});
315
+
316
+ // Min computation
317
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
318
+ void min(sycl::queue& queue,
319
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
320
+ sycl::buffer<Type, 1> min);
321
+
322
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
323
+ sycl::event min(sycl::queue& queue,
324
+ const dataset<ObservationsLayout, Type*>& data,
325
+ Type* min,
326
+ const std::vector<sycl::event> &dependencies = {});
327
+
328
+ // Max computation
329
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
330
+ void max(sycl::queue& queue,
331
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
332
+ sycl::buffer<Type, 1> max);
333
+
334
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
335
+ sycl::event max(sycl::queue& queue,
336
+ const dataset<ObservationsLayout, Type*>& data,
337
+ Type* max,
338
+ const std::vector<sycl::event> &dependencies = {});
339
+
340
+ // Min and Max computation
341
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
342
+ void min_max(sycl::queue& queue,
343
+ const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
344
+ sycl::buffer<Type, 1> min, sycl::buffer<Type, 1> max);
345
+
346
+ template<method Method = method::fast, typename Type, layout ObservationsLayout>
347
+ sycl::event min_max(sycl::queue& queue,
348
+ const dataset<ObservationsLayout, Type*>& data,
349
+ Type* min, Type* max,
350
+ const std::vector<sycl::event> &dependencies = {});
351
+
352
+ } // stats
353
+ } // mkl
354
+ } // namespace oneapi
355
+
356
+ #endif // _STATS_HPP__
@@ -0,0 +1,321 @@
1
+ /*******************************************************************************
2
+ * Copyright 2018-2022 Intel Corporation.
3
+ *
4
+ * This software and the related documents are Intel copyrighted materials, and
5
+ * your use of them is governed by the express license under which they were
6
+ * provided to you (License). Unless the License provides otherwise, you may not
7
+ * use, modify, copy, publish, distribute, disclose or transmit this software or
8
+ * the related documents without Intel's prior written permission.
9
+ *
10
+ * This software and the related documents are provided as is, with no express
11
+ * or implied warranties, other than those that are expressly stated in the
12
+ * License.
13
+ *******************************************************************************/
14
+
15
+ #ifndef _TYPES_HPP__
16
+ #define _TYPES_HPP__
17
+
18
+ #include <cstdint>
19
+ #include <cstddef> // for std::size_t
20
+ #include "mkl_types.h"
21
+ #include "mkl_cblas.h"
22
+ #include "oneapi/mkl/bfloat16.hpp"
23
+
24
+ namespace oneapi {
25
+ namespace mkl {
26
+
27
+
28
+ // BLAS flag types.
29
+ enum class transpose : char {
30
+ nontrans = 0,
31
+ trans = 1,
32
+ conjtrans = 3,
33
+ N = 0,
34
+ T = 1,
35
+ C = 3
36
+ };
37
+
38
+ enum class uplo : char {
39
+ upper = 0,
40
+ lower = 1,
41
+ U = 0,
42
+ L = 1
43
+ };
44
+
45
+ enum class diag : char {
46
+ nonunit = 0,
47
+ unit = 1,
48
+ N = 0,
49
+ U = 1
50
+ };
51
+
52
+ enum class side : char {
53
+ left = 0,
54
+ right = 1,
55
+ L = 0,
56
+ R = 1
57
+ };
58
+
59
+ enum class offset : char {
60
+ row = 0,
61
+ column = 1,
62
+ fix = 2,
63
+ R = 0,
64
+ C = 1,
65
+ F = 2
66
+ };
67
+
68
+ // LAPACK flag types.
69
+ enum class job : char {
70
+ novec = 0,
71
+ vec = 1,
72
+ updatevec = 2,
73
+ allvec = 3,
74
+ somevec = 4,
75
+ overwritevec = 5,
76
+ N = 0,
77
+ V = 1,
78
+ U = 2,
79
+ A = 3,
80
+ S = 4,
81
+ O = 5
82
+ };
83
+
84
+ enum class generate : char {
85
+ q = 0,
86
+ p = 1,
87
+ none = 2,
88
+ both = 3,
89
+ Q = 0,
90
+ P = 1,
91
+ N = 2,
92
+ V = 3
93
+ };
94
+
95
+ enum class compz : char {
96
+ novectors = 0,
97
+ vectors = 1,
98
+ initvectors = 2,
99
+ N = 0,
100
+ V = 1,
101
+ I = 2,
102
+ };
103
+
104
+ enum class direct : char {
105
+ forward = 0,
106
+ backward = 1,
107
+ F = 0,
108
+ B = 1,
109
+ };
110
+
111
+ enum class storev : char {
112
+ columnwise = 0,
113
+ rowwise = 1,
114
+ C = 0,
115
+ R = 1,
116
+ };
117
+
118
+ enum class rangev : char {
119
+ all = 0,
120
+ values = 1,
121
+ indices = 2,
122
+ A = 0,
123
+ V = 1,
124
+ I = 2,
125
+ };
126
+
127
+ enum class order : char {
128
+ block = 0,
129
+ entire = 1,
130
+ B = 0,
131
+ E = 1,
132
+ };
133
+
134
+ enum class jobsvd : char {
135
+ novec = 0,
136
+ vectors = 1,
137
+ vectorsina = 2,
138
+ somevec = 3,
139
+ N = 0,
140
+ A = 1,
141
+ O = 2,
142
+ S = 3
143
+ };
144
+ // Conversion functions to traditional Fortran characters.
145
+ inline const char * fortran_char(transpose t) {
146
+ if (t == transpose::nontrans) return "N";
147
+ if (t == transpose::trans) return "T";
148
+ if (t == transpose::conjtrans) return "C";
149
+ return "N";
150
+ }
151
+
152
+ inline const char * fortran_char(offset t) {
153
+ if (t == offset::fix) return "F";
154
+ if (t == offset::row) return "R";
155
+ if (t == offset::column) return "C";
156
+ return "N";
157
+ }
158
+
159
+ inline const char * fortran_char(uplo u) {
160
+ if (u == uplo::upper) return "U";
161
+ if (u == uplo::lower) return "L";
162
+ return "U";
163
+ }
164
+
165
+ inline const char * fortran_char(diag d) {
166
+ if (d == diag::nonunit) return "N";
167
+ if (d == diag::unit) return "U";
168
+ return "N";
169
+ }
170
+
171
+ inline const char * fortran_char(side s) {
172
+ if (s == side::left) return "L";
173
+ if (s == side::right) return "R";
174
+ return "L";
175
+ }
176
+
177
+ inline const char * fortran_char(job j) {
178
+ if (j == job::novec) return "N";
179
+ if (j == job::vec) return "V";
180
+ if (j == job::updatevec) return "U";
181
+ if (j == job::allvec) return "A";
182
+ if (j == job::somevec) return "S";
183
+ if (j == job::overwritevec) return "O";
184
+ return "N";
185
+ }
186
+ inline const char * fortran_char(jobsvd j) {
187
+ if (j == jobsvd::novec) return "N";
188
+ if (j == jobsvd::vectors) return "A";
189
+ if (j == jobsvd::vectorsina) return "O";
190
+ if (j == jobsvd::somevec) return "S";
191
+ return "N";
192
+ }
193
+
194
+ inline const char * fortran_char(generate v) {
195
+ if (v == generate::q) return "Q";
196
+ if (v == generate::p) return "P";
197
+ if (v == generate::none) return "N";
198
+ if (v == generate::both) return "B";
199
+ return "Q";
200
+ }
201
+
202
+ inline const char * fortran_char(compz c) {
203
+ if (c == compz::vectors) return "V";
204
+ if (c == compz::initvectors) return "I";
205
+ return "N";
206
+ }
207
+
208
+ inline const char * fortran_char(direct d) {
209
+ if (d == direct::backward) return "B";
210
+ return "F";
211
+ }
212
+
213
+ inline const char * fortran_char(storev s) {
214
+ if (s == storev::rowwise) return "R";
215
+ return "C";
216
+ }
217
+
218
+ inline const char * fortran_char(rangev r) {
219
+ if (r == rangev::values) return "V";
220
+ if (r == rangev::indices) return "I";
221
+ return "A";
222
+ }
223
+
224
+ inline const char * fortran_char(order o) {
225
+ if (o == order::entire) return "E";
226
+ return "B";
227
+ }
228
+
229
+ // Conversion functions to CBLAS enums.
230
+ inline MKL_TRANSPOSE cblas_convert(transpose t) {
231
+ if (t == transpose::nontrans) return MKL_NOTRANS;
232
+ if (t == transpose::trans) return MKL_TRANS;
233
+ if (t == transpose::conjtrans) return MKL_CONJTRANS;
234
+ return MKL_NOTRANS;
235
+ }
236
+
237
+ inline MKL_UPLO cblas_convert(uplo u) {
238
+ if (u == uplo::upper) return MKL_UPPER;
239
+ if (u == uplo::lower) return MKL_LOWER;
240
+ return MKL_UPPER;
241
+ }
242
+
243
+ inline MKL_DIAG cblas_convert(diag d) {
244
+ if (d == diag::nonunit) return MKL_NONUNIT;
245
+ if (d == diag::unit) return MKL_UNIT;
246
+ return MKL_NONUNIT;
247
+ }
248
+
249
+ inline MKL_SIDE cblas_convert(side s) {
250
+ if (s == side::left) return MKL_LEFT;
251
+ if (s == side::right) return MKL_RIGHT;
252
+ return MKL_LEFT;
253
+ }
254
+
255
+ enum class index_base : char {
256
+ zero = 0,
257
+ one = 1,
258
+ };
259
+
260
+ enum class layout : char {
261
+ row_major = 0,
262
+ col_major = 1,
263
+ R = 0,
264
+ C = 1,
265
+ };
266
+
267
+ #ifndef _ONEAPI_MKL_SLICE_
268
+ #define _ONEAPI_MKL_SLICE_ 1
269
+ struct slice {
270
+ std::size_t start;
271
+ std::size_t size;
272
+ std::int64_t stride;
273
+
274
+ constexpr slice(): start(0), size(0), stride(0) { }
275
+ constexpr slice(slice const &rhs) = default;
276
+ constexpr slice& operator =(slice const &rhs) = default;
277
+
278
+ constexpr slice(std::size_t _start, std::size_t _size, std::int64_t _stride): start(_start), size(_size), stride(_stride) { }
279
+ }; /* struct slice */
280
+ #endif
281
+
282
+ template <typename T>
283
+ class value_or_pointer {
284
+ T value_;
285
+ const T *ptr_;
286
+
287
+ public:
288
+ // Constructor from value. Accepts not only type T but anything convertible to T.
289
+ template <typename U, std::enable_if_t<std::is_convertible_v<U, T>, int> = 0>
290
+ value_or_pointer(U value) : value_(value), ptr_(nullptr) {}
291
+
292
+ // Constructor from pointer, assumed to be device-accessible.
293
+ value_or_pointer(const T *ptr): value_(T(0)), ptr_(ptr) {}
294
+
295
+ bool fixed() const {
296
+ return ptr_ == nullptr;
297
+ }
298
+
299
+ T get_fixed_value() const {
300
+ return value_;
301
+ }
302
+
303
+ const T* get_pointer() const {
304
+ return ptr_;
305
+ }
306
+
307
+ T get() const {
308
+ return ptr_ ? *ptr_ : value_;
309
+ }
310
+
311
+ void make_device_accessible(sycl::queue& queue) {
312
+ if (!fixed() && sycl::get_pointer_type(ptr_, queue.get_context()) == sycl::usm::alloc::unknown) {
313
+ *this = *ptr_;
314
+ }
315
+ }
316
+ };
317
+
318
+ } /* namespace mkl */
319
+ } // namespace oneapi
320
+
321
+ #endif /* _TYPES_HPP__ */