mkl-devel-dpcpp 2025.1.0__py2.py3-none-win_amd64.whl → 2025.3.0__py2.py3-none-win_amd64.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.
Files changed (103) hide show
  1. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.3.0.data}/data/Library/lib/mkl_sycl.lib +0 -0
  2. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.3.0.data}/data/Library/lib/mkl_sycl_blas_dll.lib +0 -0
  3. mkl_devel_dpcpp-2025.3.0.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
  4. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.3.0.data}/data/Library/lib/mkl_sycl_dll.lib +0 -0
  5. mkl_devel_dpcpp-2025.3.0.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
  6. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.3.0.data}/data/Library/lib/mkl_sycl_rng_dll.lib +0 -0
  7. mkl_devel_dpcpp-2025.3.0.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
  8. {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.3.0.dist-info}/METADATA +5 -4
  9. mkl_devel_dpcpp-2025.3.0.dist-info/RECORD +15 -0
  10. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/bfloat16.hpp +0 -26
  11. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/buffer.hpp +0 -42
  12. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/buffer_decls.hpp +0 -880
  13. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/spec.hpp +0 -42
  14. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/types.hpp +0 -60
  15. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/usm.hpp +0 -42
  16. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/usm_decls.hpp +0 -1240
  17. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas.hpp +0 -34
  18. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dft/spec.hpp +0 -42
  19. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dft.hpp +0 -254
  20. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dfti.hpp +0 -22
  21. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/exceptions.hpp +0 -110
  22. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/interpolate.hpp +0 -67
  23. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/spline_and_data_params.hpp +0 -68
  24. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/splines.hpp +0 -177
  25. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting.hpp +0 -22
  26. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/export.hpp +0 -25
  27. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/concepts.hpp +0 -55
  28. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/exceptions.hpp +0 -75
  29. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/lapack.hpp +0 -1096
  30. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/scratchpad.hpp +0 -107
  31. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/spec.hpp +0 -42
  32. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack.hpp +0 -24
  33. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/detail/engine_base.hpp +0 -48
  34. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/bernoulli_impl.hpp +0 -89
  35. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/beta_impl.hpp +0 -463
  36. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/bits_impl.hpp +0 -71
  37. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/distribution_base.hpp +0 -85
  38. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_base.hpp +0 -43
  39. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_helpers_base.hpp +0 -54
  40. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/exponential_impl.hpp +0 -116
  41. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/gamma_impl.hpp +0 -285
  42. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/gaussian_impl.hpp +0 -270
  43. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/geometric_impl.hpp +0 -99
  44. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/lognormal_impl.hpp +0 -105
  45. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_helpers_impl.hpp +0 -117
  46. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_impl.hpp +0 -223
  47. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_helpers_impl.hpp +0 -118
  48. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_impl.hpp +0 -266
  49. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_helpers_impl.hpp +0 -125
  50. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_impl.hpp +0 -385
  51. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_skip_ahead_matrix.hpp +0 -3668
  52. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_helpers_impl.hpp +0 -141
  53. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_impl.hpp +0 -552
  54. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/poisson_impl.hpp +0 -328
  55. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/types.hpp +0 -58
  56. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_bits_impl.hpp +0 -51
  57. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_impl.hpp +0 -287
  58. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/vm_wrappers.hpp +0 -183
  59. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/distributions.hpp +0 -700
  60. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/engine_helpers.hpp +0 -116
  61. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/engines.hpp +0 -187
  62. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/functions.hpp +0 -59
  63. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/types.hpp +0 -79
  64. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device.hpp +0 -29
  65. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/distributions.hpp +0 -1913
  66. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/engines.hpp +0 -788
  67. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/functions.hpp +0 -163
  68. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/spec.hpp +0 -42
  69. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng.hpp +0 -23
  70. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_auxiliary.hpp +0 -111
  71. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_operations.hpp +0 -446
  72. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_structures.hpp +0 -193
  73. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/spec.hpp +0 -42
  74. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas.hpp +0 -33
  75. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spec.hpp +0 -42
  76. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/stats/spec.hpp +0 -42
  77. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/stats.hpp +0 -357
  78. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/types.hpp +0 -321
  79. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/buffer.hpp +0 -3529
  80. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/decls.hpp +0 -280
  81. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/decls.hpp +0 -81
  82. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/dispatch.hpp +0 -1059
  83. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/ep.hpp +0 -861
  84. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/ha.hpp +0 -860
  85. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/la.hpp +0 -860
  86. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/rts.hpp +0 -4608
  87. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/scalar.hpp +0 -8963
  88. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/vm.hpp +0 -460
  89. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/span.hpp +0 -3813
  90. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/spec.hpp +0 -42
  91. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/usm.hpp +0 -3581
  92. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm.hpp +0 -31
  93. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl.hpp +0 -35
  94. mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
  95. mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
  96. mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
  97. mkl_devel_dpcpp-2025.1.0.dist-info/RECORD +0 -99
  98. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.3.0.data}/data/Library/lib/mkl_sycl_data_fitting_dll.lib +0 -0
  99. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.3.0.data}/data/Library/lib/mkl_sycl_stats_dll.lib +0 -0
  100. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.3.0.data}/data/Library/lib/mkl_sycl_vm_dll.lib +0 -0
  101. {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.3.0.dist-info}/LICENSE.txt +0 -0
  102. {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.3.0.dist-info}/WHEEL +0 -0
  103. {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.3.0.dist-info}/top_level.txt +0 -0
@@ -1,270 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright (C) 2020 Intel Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing,
11
- * software distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions
14
- * and limitations under the License.
15
- *
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- *******************************************************************************/
19
-
20
- #ifndef _MKL_RNG_DEVICE_GAUSSIAN_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_GAUSSIAN_IMPL_HPP_
22
-
23
- #include "vm_wrappers.hpp"
24
-
25
- namespace oneapi::mkl::rng::device::detail {
26
-
27
- // sqrt(2)
28
- template <typename RealType = float>
29
- constexpr inline RealType sqrt2() {
30
- return 0x1.6A09E6P+0f; // 1.414213562
31
- }
32
-
33
- template <>
34
- constexpr inline double sqrt2<double>() {
35
- return 0x1.6A09E667F3BCDP+0; // 1.414213562
36
- }
37
-
38
- template <typename RealType>
39
- class distribution_base<
40
- oneapi::mkl::rng::device::gaussian<RealType, gaussian_method::box_muller2>> {
41
- public:
42
- struct param_type {
43
- param_type(RealType mean, RealType stddev) : mean_(mean), stddev_(stddev) {}
44
- RealType mean_;
45
- RealType stddev_;
46
- };
47
-
48
- distribution_base(RealType mean, RealType stddev) : mean_(mean), stddev_(stddev) {
49
- flag_ = false;
50
- #ifndef __SYCL_DEVICE_ONLY__
51
- if (stddev <= RealType(0)) {
52
- throw oneapi::mkl::invalid_argument("rng", "gaussian", "stddev <= 0");
53
- }
54
- #endif
55
- }
56
-
57
- RealType mean() const {
58
- return mean_;
59
- }
60
-
61
- RealType stddev() const {
62
- return stddev_;
63
- }
64
-
65
- param_type param() const {
66
- return param_type(mean_, stddev_);
67
- }
68
-
69
- void param(const param_type& pt) {
70
- #ifndef __SYCL_DEVICE_ONLY__
71
- if (pt.stddev_ <= RealType(0)) {
72
- throw oneapi::mkl::invalid_argument("rng", "gaussian", "stddev <= 0");
73
- }
74
- #endif
75
- mean_ = pt.mean_;
76
- stddev_ = pt.stddev_;
77
- }
78
-
79
- protected:
80
- template <typename EngineType>
81
- __attribute__((always_inline)) inline auto generate(EngineType& engine) ->
82
- typename std::conditional<EngineType::vec_size == 1, RealType,
83
- sycl::vec<RealType, EngineType::vec_size>>::type {
84
- RealType u1, u2, u1_transformed;
85
-
86
- if constexpr (EngineType::vec_size == 1) {
87
- RealType res;
88
- if (!flag_) {
89
- u1 = engine.generate(RealType(0), RealType(1));
90
- u2 = engine.generate(RealType(0), RealType(1));
91
- u1_transformed = ln_wrapper(u1);
92
- u1_transformed = sqrt_wrapper(static_cast<RealType>(-2.0) * u1_transformed);
93
- res = u1_transformed * sinpi_wrapper(RealType(2) * u2) * stddev_ + mean_;
94
- u1_transformed_ = u1_transformed;
95
- u2_ = u2;
96
- flag_ = true;
97
- return res;
98
- }
99
- res = u1_transformed_ * cospi_wrapper(RealType(2) * u2_) * stddev_ + mean_;
100
- flag_ = false;
101
- return res;
102
- }
103
- else {
104
- RealType sin, cos;
105
- sycl::vec<RealType, EngineType::vec_size> res;
106
- if (!flag_) {
107
- constexpr std::int32_t tail = EngineType::vec_size % 2;
108
- auto uniform_res = engine.generate(RealType(0), RealType(1));
109
- #pragma unroll
110
- for (std::int32_t i = 0; i < EngineType::vec_size - tail; i += 2) {
111
- u1 = uniform_res[i];
112
- u2 = uniform_res[i + 1];
113
- u1_transformed = ln_wrapper(u1);
114
- u1_transformed = sqrt_wrapper(static_cast<RealType>(-2.0) * u1_transformed);
115
- sin = sincospi_wrapper(RealType(2.0) * u2, cos);
116
- res[i] = (u1_transformed * sin) * stddev_ + mean_;
117
- res[i + 1] = (u1_transformed * cos) * stddev_ + mean_;
118
- }
119
- if constexpr (tail) {
120
- u1 = uniform_res[EngineType::vec_size - 1];
121
- u2 = engine.generate_single(RealType(0), RealType(1));
122
- u1_transformed = ln_wrapper(u1);
123
- u1_transformed = sqrt_wrapper(static_cast<RealType>(-2.0) * u1_transformed);
124
- res[EngineType::vec_size - 1] =
125
- u1_transformed * sinpi_wrapper(RealType(2) * u2) * stddev_ + mean_;
126
- u1_transformed_ = u1_transformed;
127
- u2_ = u2;
128
- flag_ = true;
129
- }
130
- return res;
131
- }
132
-
133
- res[0] = u1_transformed_ * cospi_wrapper(RealType(2) * u2_) * stddev_ + mean_;
134
- flag_ = false;
135
- constexpr std::int32_t tail = (EngineType::vec_size - 1) % 2;
136
- #pragma unroll
137
- for (std::int32_t i = 1; i < EngineType::vec_size - tail; i += 2) {
138
- u1 = engine.generate_single(RealType(0), RealType(1));
139
- u2 = engine.generate_single(RealType(0), RealType(1));
140
- u1_transformed = ln_wrapper(u1);
141
- u1_transformed = sqrt_wrapper(static_cast<RealType>(-2.0) * u1_transformed);
142
- sin = sincospi_wrapper(RealType(2.0) * u2, cos);
143
- res[i] = (u1_transformed * sin) * stddev_ + mean_;
144
- res[i + 1] = (u1_transformed * cos) * stddev_ + mean_;
145
- }
146
- if constexpr (tail) {
147
- u1 = engine.generate_single(RealType(0), RealType(1));
148
- u2 = engine.generate_single(RealType(0), RealType(1));
149
- u1_transformed = ln_wrapper(u1);
150
- u1_transformed = sqrt_wrapper(static_cast<RealType>(-2.0) * u1_transformed);
151
- res[EngineType::vec_size - 1] =
152
- u1_transformed * sinpi_wrapper(RealType(2) * u2) * stddev_ + mean_;
153
- u1_transformed_ = u1_transformed;
154
- u2_ = u2;
155
- flag_ = true;
156
- }
157
- return res;
158
- }
159
- }
160
-
161
- template <typename EngineType>
162
- __attribute__((always_inline)) inline RealType generate_single(EngineType& engine) {
163
- RealType u1, u2, u1_transformed;
164
- RealType res;
165
- if (!flag_) {
166
- u1 = engine.generate_single(RealType(0), RealType(1));
167
- u2 = engine.generate_single(RealType(0), RealType(1));
168
- u1_transformed = ln_wrapper(u1);
169
- u1_transformed = sqrt_wrapper(static_cast<RealType>(-2.0) * u1_transformed);
170
- res = u1_transformed * sinpi_wrapper(RealType(2) * u2) * stddev_ + mean_;
171
- u1_transformed_ = u1_transformed;
172
- u2_ = u2;
173
- flag_ = true;
174
- return res;
175
- }
176
- res = u1_transformed_ * cospi_wrapper(RealType(2) * u2_) * stddev_ + mean_;
177
- flag_ = false;
178
- return res;
179
- }
180
-
181
- RealType mean_;
182
- RealType stddev_;
183
- bool flag_ = false;
184
- RealType u1_transformed_;
185
- RealType u2_;
186
-
187
- friend class distribution_base<
188
- oneapi::mkl::rng::device::lognormal<RealType, lognormal_method::box_muller2>>;
189
- friend class distribution_base<
190
- oneapi::mkl::rng::device::poisson<std::int32_t, poisson_method::devroye>>;
191
- friend class distribution_base<
192
- oneapi::mkl::rng::device::poisson<std::uint32_t, poisson_method::devroye>>;
193
- };
194
-
195
- #if MKL_RNG_USE_BINARY_CODE
196
-
197
- template <typename RealType>
198
- class distribution_base<oneapi::mkl::rng::device::gaussian<RealType, gaussian_method::icdf>> {
199
- public:
200
- struct param_type {
201
- param_type(RealType mean, RealType stddev) : mean_(mean), stddev_(stddev) {}
202
- RealType mean_;
203
- RealType stddev_;
204
- };
205
-
206
- distribution_base(RealType mean, RealType stddev) : mean_(mean), stddev_(stddev) {
207
- #ifndef __SYCL_DEVICE_ONLY__
208
- if (stddev <= RealType(0)) {
209
- throw oneapi::mkl::invalid_argument("rng", "gaussian", "stddev <= 0");
210
- }
211
- #endif
212
- }
213
-
214
- RealType mean() const {
215
- return mean_;
216
- }
217
-
218
- RealType stddev() const {
219
- return stddev_;
220
- }
221
-
222
- param_type param() const {
223
- return param_type(mean_, stddev_);
224
- }
225
-
226
- void param(const param_type& pt) {
227
- #ifndef __SYCL_DEVICE_ONLY__
228
- if (pt.stddev_ <= RealType(0)) {
229
- throw oneapi::mkl::invalid_argument("rng", "gaussian", "stddev <= 0");
230
- }
231
- #endif
232
- mean_ = pt.mean_;
233
- stddev_ = pt.stddev_;
234
- }
235
-
236
- protected:
237
- template <typename EngineType>
238
- __attribute__((always_inline)) inline auto generate(EngineType& engine) ->
239
- typename std::conditional<EngineType::vec_size == 1, RealType,
240
- sycl::vec<RealType, EngineType::vec_size>>::type {
241
- if constexpr (EngineType::vec_size == 1) {
242
- return generate_single(engine);
243
- }
244
- else {
245
- RealType stddev = stddev_ * sqrt2<RealType>();
246
- sycl::vec<RealType, EngineType::vec_size> res;
247
- sycl::vec<RealType, EngineType::vec_size> u =
248
- engine.generate(RealType(-1), RealType(1));
249
- for (std::int32_t i = 0; i < EngineType::vec_size; i++) {
250
- res[i] = erf_inv_wrapper(u[i]);
251
- }
252
- return res * stddev + mean_;
253
- }
254
- }
255
-
256
- template <typename EngineType>
257
- __attribute__((always_inline)) inline RealType generate_single(EngineType& engine) {
258
- RealType stddev = stddev_ * sqrt2<RealType>();
259
- RealType u = engine.generate_single(RealType(-1), RealType(1));
260
- return sycl::fma(erf_inv_wrapper(u), stddev, mean_);
261
- }
262
-
263
- RealType mean_;
264
- RealType stddev_;
265
- };
266
- #endif
267
-
268
- } // namespace oneapi::mkl::rng::device::detail
269
-
270
- #endif // _MKL_RNG_DEVICE_GAUSSIAN_IMPL_HPP_
@@ -1,99 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright (C) 2024 Intel Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing,
11
- * software distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions
14
- * and limitations under the License.
15
- *
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- *******************************************************************************/
19
-
20
- #ifndef _MKL_RNG_DEVICE_GEOMETRIC_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_GEOMETRIC_IMPL_HPP_
22
-
23
- namespace oneapi::mkl::rng::device::detail {
24
-
25
- template <typename IntType, typename Method>
26
- class distribution_base<oneapi::mkl::rng::device::geometric<IntType, Method>> {
27
- public:
28
- struct param_type {
29
- param_type(float p) : p_(p) {}
30
- float p_;
31
- };
32
-
33
- distribution_base(float p) : p_(p) {
34
- #ifndef __SYCL_DEVICE_ONLY__
35
- if ((p > 1.0f) || (p < 0.0f)) {
36
- throw oneapi::mkl::invalid_argument("rng", "geometric", "p < 0 || p > 1");
37
- }
38
- #endif
39
- }
40
-
41
- float p() const {
42
- return p_;
43
- }
44
-
45
- param_type param() const {
46
- return param_type(p_);
47
- }
48
-
49
- void param(const param_type& pt) {
50
- #ifndef __SYCL_DEVICE_ONLY__
51
- if ((pt.p_ > 1.0f) || (pt.p_ < 0.0f)) {
52
- throw oneapi::mkl::invalid_argument("rng", "geometric", "p < 0 || p > 1");
53
- }
54
- #endif
55
- p_ = pt.p_;
56
- }
57
-
58
- protected:
59
- template <typename EngineType>
60
- auto generate(EngineType& engine) ->
61
- typename std::conditional<EngineType::vec_size == 1, IntType,
62
- sycl::vec<IntType, EngineType::vec_size>>::type {
63
- using FpType = typename std::conditional<std::is_same_v<IntType, std::uint64_t> ||
64
- std::is_same_v<IntType, std::int64_t>,
65
- double, float>::type;
66
-
67
- auto uni_res = engine.generate(FpType(0.0), FpType(1.0));
68
- FpType inv_ln = ln_wrapper(FpType(1.0) - p_);
69
- inv_ln = FpType(1.0) / inv_ln;
70
- if constexpr (EngineType::vec_size == 1) {
71
- return static_cast<IntType>(sycl::floor(ln_wrapper(uni_res) * inv_ln));
72
- }
73
- else {
74
- sycl::vec<IntType, EngineType::vec_size> vec_out;
75
- for (int i = 0; i < EngineType::vec_size; i++) {
76
- vec_out[i] = static_cast<IntType>(sycl::floor(ln_wrapper(uni_res[i]) * inv_ln));
77
- }
78
- return vec_out;
79
- }
80
- }
81
-
82
- template <typename EngineType>
83
- IntType generate_single(EngineType& engine) {
84
- using FpType = typename std::conditional<std::is_same_v<IntType, std::uint64_t> ||
85
- std::is_same_v<IntType, std::int64_t>,
86
- double, float>::type;
87
-
88
- FpType uni_res = engine.generate_single(FpType(0.0), FpType(1.0));
89
- FpType inv_ln = ln_wrapper(FpType(1.0) - p_);
90
- inv_ln = FpType(1.0) / inv_ln;
91
- return static_cast<IntType>(sycl::floor(ln_wrapper(uni_res) * inv_ln));
92
- }
93
-
94
- float p_;
95
- };
96
-
97
- } // namespace oneapi::mkl::rng::device::detail
98
-
99
- #endif // _MKL_RNG_DEVICE_GEOMETRIC_IMPL_HPP_
@@ -1,105 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright (C) 2020 Intel Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing,
11
- * software distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions
14
- * and limitations under the License.
15
- *
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- *******************************************************************************/
19
-
20
- #ifndef _MKL_RNG_DEVICE_LOGNORMAL_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_LOGNORMAL_IMPL_HPP_
22
-
23
- namespace oneapi::mkl::rng::device::detail {
24
-
25
- template <typename RealType, typename Method>
26
- class distribution_base<oneapi::mkl::rng::device::lognormal<RealType, Method>> {
27
- public:
28
- struct param_type {
29
- param_type(RealType m, RealType s, RealType displ, RealType scale)
30
- : m_(m),
31
- s_(s),
32
- displ_(displ),
33
- scale_(scale) {}
34
- RealType m_;
35
- RealType s_;
36
- RealType displ_;
37
- RealType scale_;
38
- };
39
-
40
- distribution_base(RealType m, RealType s, RealType displ, RealType scale)
41
- : gaussian_(m, s),
42
- displ_(displ),
43
- scale_(scale) {
44
- #ifndef __SYCL_DEVICE_ONLY__
45
- if (scale <= static_cast<RealType>(0.0)) {
46
- throw oneapi::mkl::invalid_argument("rng", "lognormal", "scale <= 0");
47
- }
48
- #endif
49
- }
50
-
51
- RealType m() const {
52
- return gaussian_.mean();
53
- }
54
-
55
- RealType s() const {
56
- return gaussian_.stddev();
57
- }
58
-
59
- RealType displ() const {
60
- return displ_;
61
- }
62
-
63
- RealType scale() const {
64
- return scale_;
65
- }
66
-
67
- param_type param() const {
68
- return param_type(gaussian_.mean(), gaussian_.stddev(), displ_, scale_);
69
- }
70
-
71
- void param(const param_type& pt) {
72
- #ifndef __SYCL_DEVICE_ONLY__
73
- if (pt.scale_ <= static_cast<RealType>(0.0)) {
74
- throw oneapi::mkl::invalid_argument("rng", "lognormal", "scale <= 0");
75
- }
76
- #endif
77
- gaussian_.param({ pt.m_, pt.s_ });
78
- displ_ = pt.displ_;
79
- scale_ = pt.scale_;
80
- }
81
-
82
- protected:
83
- template <typename EngineType>
84
- auto generate(EngineType& engine) ->
85
- typename std::conditional<EngineType::vec_size == 1, RealType,
86
- sycl::vec<RealType, EngineType::vec_size>>::type {
87
- auto res = gaussian_.generate(engine);
88
- return sycl::exp(res) * scale_ + displ_;
89
- }
90
-
91
- template <typename EngineType>
92
- RealType generate_single(EngineType& engine) {
93
- RealType res = gaussian_.generate_single(engine);
94
- return sycl::exp(res) * scale_ + displ_;
95
- }
96
-
97
- distribution_base<oneapi::mkl::rng::device::gaussian<RealType, gaussian_method::box_muller2>>
98
- gaussian_;
99
- RealType displ_;
100
- RealType scale_;
101
- };
102
-
103
- } // namespace oneapi::mkl::rng::device::detail
104
-
105
- #endif // _MKL_RNG_DEVICE_LOGNORMAL_IMPL_HPP_
@@ -1,117 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright (C) 2023 Intel Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing,
11
- * software distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions
14
- * and limitations under the License.
15
- *
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- *******************************************************************************/
19
-
20
- #ifndef _MKL_RNG_DEVICE_MCG31M1_HELPERS_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_MCG31M1_HELPERS_IMPL_HPP_
22
-
23
- #include "oneapi/mkl/rng/device/detail/mcg31m1_impl.hpp"
24
-
25
- namespace oneapi::mkl::rng::device::detail {
26
- namespace mcg31m1_impl {
27
-
28
- template <std::int32_t VecSize>
29
- static inline void init(
30
- engine_state<oneapi::mkl::rng::device::mcg31m1<VecSize>> &state, std::size_t id,
31
- const sycl::accessor<std::uint32_t, 1, sycl::access::mode::read_write> &accessor) {
32
- std::size_t num_elements_acc =
33
- sizeof(engine_state<oneapi::mkl::rng::device::mcg31m1<VecSize>>) / sizeof(std::uint32_t);
34
- state.s = accessor[id * num_elements_acc];
35
- }
36
-
37
- template <std::int32_t VecSize>
38
- static inline void store(
39
- engine_state<oneapi::mkl::rng::device::mcg31m1<VecSize>> &state, std::size_t id,
40
- const sycl::accessor<std::uint32_t, 1, sycl::access::mode::read_write> &accessor) {
41
- std::size_t num_elements_acc =
42
- sizeof(engine_state<oneapi::mkl::rng::device::mcg31m1<VecSize>>) / sizeof(std::uint32_t);
43
- accessor[id * num_elements_acc] = state.s;
44
- }
45
-
46
- } // namespace mcg31m1_impl
47
-
48
- template <std::int32_t VecSize>
49
- class engine_accessor_base<oneapi::mkl::rng::device::mcg31m1<VecSize>> {
50
- public:
51
- engine_accessor_base(sycl::buffer<std::uint32_t, 1> &state_buf, sycl::handler &cgh)
52
- : states_accessor_(state_buf, cgh) {}
53
-
54
- oneapi::mkl::rng::device::mcg31m1<VecSize> load(std::size_t id) const {
55
- oneapi::mkl::rng::device::mcg31m1<VecSize> engine;
56
- mcg31m1_impl::init(engine.state_, id, states_accessor_);
57
- return engine;
58
- }
59
-
60
- void store(oneapi::mkl::rng::device::mcg31m1<VecSize> &engine, std::size_t id) const {
61
- mcg31m1_impl::store(engine.state_, id, states_accessor_);
62
- }
63
-
64
- protected:
65
- sycl::accessor<std::uint32_t, 1, sycl::access::mode::read_write> states_accessor_;
66
- };
67
-
68
- template <std::int32_t VecSize>
69
- class engine_descriptor_base<oneapi::mkl::rng::device::mcg31m1<VecSize>> {
70
- public:
71
- using engine_type = oneapi::mkl::rng::device::mcg31m1<VecSize>;
72
-
73
- using accessor_type =
74
- oneapi::mkl::rng::device::engine_accessor<oneapi::mkl::rng::device::mcg31m1<VecSize>>;
75
-
76
- engine_descriptor_base(sycl::queue &queue, sycl::range<1> range, std::uint32_t seed,
77
- std::uint64_t offset)
78
- : states_buffer_(range.get(0) * sizeof(engine_state<engine_type>) /
79
- sizeof(std::uint32_t)) {
80
- queue.submit([&](sycl::handler &cgh) {
81
- accessor_type states_accessor(states_buffer_, cgh);
82
-
83
- cgh.parallel_for<class init_kernel<engine_type>>
84
- (range, [=](sycl::item<1> item) {
85
- std::size_t id = item.get_id(0);
86
- oneapi::mkl::rng::device::mcg31m1<VecSize> engine(seed, offset *id);
87
- states_accessor.store(engine, id);
88
- });
89
- });
90
- }
91
-
92
- template <typename InitEngineFunc>
93
- engine_descriptor_base(sycl::queue &queue, sycl::range<1> range, InitEngineFunc func)
94
- : states_buffer_(range.get(0) * sizeof(engine_state<engine_type>) /
95
- sizeof(std::uint32_t)) {
96
- queue.submit([&](sycl::handler &cgh) {
97
- accessor_type states_accessor(states_buffer_, cgh);
98
-
99
- cgh.parallel_for<class init_kernel_ex<engine_type>>
100
- (range, [=](sycl::item<1> item) {
101
- std::size_t id = item.get_id(0);
102
- states_accessor.store(func(item), id);
103
- });
104
- });
105
- }
106
-
107
- accessor_type get_access(sycl::handler &cgh) {
108
- return accessor_type{ states_buffer_, cgh };
109
- }
110
-
111
- protected:
112
- sycl::buffer<std::uint32_t, 1> states_buffer_;
113
- };
114
-
115
- } // namespace oneapi::mkl::rng::device::detail
116
-
117
- #endif // _MKL_RNG_DEVICE_MCG31M1_HELPERS_IMPL_HPP_