mkl-devel-dpcpp 2025.1.0__py2.py3-none-win_amd64.whl → 2025.2.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.

Potentially problematic release.


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

Files changed (103) hide show
  1. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl.lib +0 -0
  2. mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
  3. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_dll.lib +0 -0
  4. mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
  5. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_rng_dll.lib +0 -0
  6. mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
  7. {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/METADATA +4 -3
  8. mkl_devel_dpcpp-2025.2.0.dist-info/RECORD +15 -0
  9. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/bfloat16.hpp +0 -26
  10. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/buffer.hpp +0 -42
  11. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/buffer_decls.hpp +0 -880
  12. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/spec.hpp +0 -42
  13. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/types.hpp +0 -60
  14. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/usm.hpp +0 -42
  15. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/usm_decls.hpp +0 -1240
  16. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas.hpp +0 -34
  17. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dft/spec.hpp +0 -42
  18. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dft.hpp +0 -254
  19. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dfti.hpp +0 -22
  20. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/exceptions.hpp +0 -110
  21. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/interpolate.hpp +0 -67
  22. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/spline_and_data_params.hpp +0 -68
  23. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/splines.hpp +0 -177
  24. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting.hpp +0 -22
  25. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/export.hpp +0 -25
  26. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/concepts.hpp +0 -55
  27. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/exceptions.hpp +0 -75
  28. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/lapack.hpp +0 -1096
  29. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/scratchpad.hpp +0 -107
  30. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/spec.hpp +0 -42
  31. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack.hpp +0 -24
  32. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/detail/engine_base.hpp +0 -48
  33. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/bernoulli_impl.hpp +0 -89
  34. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/beta_impl.hpp +0 -463
  35. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/bits_impl.hpp +0 -71
  36. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/distribution_base.hpp +0 -85
  37. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_base.hpp +0 -43
  38. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_helpers_base.hpp +0 -54
  39. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/exponential_impl.hpp +0 -116
  40. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/gamma_impl.hpp +0 -285
  41. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/gaussian_impl.hpp +0 -270
  42. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/geometric_impl.hpp +0 -99
  43. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/lognormal_impl.hpp +0 -105
  44. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_helpers_impl.hpp +0 -117
  45. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_impl.hpp +0 -223
  46. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_helpers_impl.hpp +0 -118
  47. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_impl.hpp +0 -266
  48. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_helpers_impl.hpp +0 -125
  49. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_impl.hpp +0 -385
  50. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_skip_ahead_matrix.hpp +0 -3668
  51. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_helpers_impl.hpp +0 -141
  52. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_impl.hpp +0 -552
  53. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/poisson_impl.hpp +0 -328
  54. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/types.hpp +0 -58
  55. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_bits_impl.hpp +0 -51
  56. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_impl.hpp +0 -287
  57. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/vm_wrappers.hpp +0 -183
  58. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/distributions.hpp +0 -700
  59. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/engine_helpers.hpp +0 -116
  60. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/engines.hpp +0 -187
  61. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/functions.hpp +0 -59
  62. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/types.hpp +0 -79
  63. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device.hpp +0 -29
  64. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/distributions.hpp +0 -1913
  65. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/engines.hpp +0 -788
  66. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/functions.hpp +0 -163
  67. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/spec.hpp +0 -42
  68. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng.hpp +0 -23
  69. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_auxiliary.hpp +0 -111
  70. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_operations.hpp +0 -446
  71. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_structures.hpp +0 -193
  72. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/spec.hpp +0 -42
  73. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas.hpp +0 -33
  74. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spec.hpp +0 -42
  75. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/stats/spec.hpp +0 -42
  76. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/stats.hpp +0 -357
  77. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/types.hpp +0 -321
  78. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/buffer.hpp +0 -3529
  79. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/decls.hpp +0 -280
  80. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/decls.hpp +0 -81
  81. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/dispatch.hpp +0 -1059
  82. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/ep.hpp +0 -861
  83. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/ha.hpp +0 -860
  84. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/la.hpp +0 -860
  85. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/rts.hpp +0 -4608
  86. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/scalar.hpp +0 -8963
  87. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/vm.hpp +0 -460
  88. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/span.hpp +0 -3813
  89. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/spec.hpp +0 -42
  90. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/usm.hpp +0 -3581
  91. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm.hpp +0 -31
  92. mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl.hpp +0 -35
  93. mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
  94. mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
  95. mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
  96. mkl_devel_dpcpp-2025.1.0.dist-info/RECORD +0 -99
  97. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_blas_dll.lib +0 -0
  98. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.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.2.0.data}/data/Library/lib/mkl_sycl_stats_dll.lib +0 -0
  100. {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.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.2.0.dist-info}/LICENSE.txt +0 -0
  102. {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/WHEEL +0 -0
  103. {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/top_level.txt +0 -0
@@ -1,328 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright (C) 2021 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_POISSON_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_POISSON_IMPL_HPP_
22
-
23
- #include <limits>
24
-
25
- namespace oneapi::mkl::rng::device::detail {
26
-
27
- // Implementation of Poisson distribution uses 3 methods depending on lambda parameter:
28
- // - table-lookup method [1] for small lambdas (lambda < 60)
29
- // - Devroye's method [2] for medium lambdas (60 <= lambda < 1000)
30
- // - Gaussian approximation [1] for huge lambdas (lambda >= 1000)
31
- //
32
- // References:
33
- // [1] Michael B. Giles // Algorithm 955: approximation of the inverse Poisson cumulative
34
- // distribution function
35
- // [2] Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag,
36
- // New York, 1986, Ch. X, Sects. 3.3 & 3.4 + Errata
37
-
38
- #define RNG_POISSON_LAMBDA_HUGE_BOUND 1000.0
39
- #define RNG_POISSON_LAMBDA_LOW_BOUND 60.0
40
- #define RNG_POISSON_N_PRECOMPUTED_CDF 32
41
-
42
- struct poisson_parameters {
43
- void set_lambda(double lambda) {
44
- if (lambda >= RNG_POISSON_LAMBDA_HUGE_BOUND) {
45
- sqrt_lambda_ = sycl::sqrt(lambda);
46
- }
47
- else if (lambda >= RNG_POISSON_LAMBDA_LOW_BOUND) {
48
- floored_lambda_ = sycl::floor(lambda);
49
- log_lambda_ = sycl::log(lambda);
50
- lgamma_floored_lambda_ = sycl::lgamma(floored_lambda_ + 1.0);
51
- sqrt_floored_lambda_ = sycl::sqrt(floored_lambda_);
52
- dx_ = sycl::sqrt(2.0 * floored_lambda_ * sycl::log(32.0 * floored_lambda_ / pi_4_));
53
- delta_ = sycl::round((sycl::max)(6.0, (sycl::min)(floored_lambda_, dx_)));
54
- dpdfl_ = delta_ + 2.0 * floored_lambda_;
55
- sqrt_half_dpdfl_ = sycl::sqrt(dpdfl_ / 2.0);
56
- inv_dpdfl_ = 1.0 / dpdfl_;
57
- c2_add_coeff_ = sycl::sqrt(pi_4_ * dpdfl_) * sycl::exp(inv_dpdfl_);
58
- c_add_coeff_ =
59
- 2.0 * dpdfl_ * sycl::exp(-delta_ * inv_dpdfl_ * (1.0 + delta_ / 2.0)) / delta_;
60
- c1_ = sqrt_floored_lambda_ * spi_2_;
61
- c2_ = c2_add_coeff_ + c1_;
62
- c3_ = c2_ + 1.0;
63
- c4_ = c2_ + 2.0;
64
- c5_ = c4_ + exp_one_by_78;
65
- c_ = c5_ + c_add_coeff_;
66
- }
67
- else {
68
- prob[0] = sycl::exp(-lambda);
69
- double tmp = prob[0];
70
- for (int i = 1; i < RNG_POISSON_N_PRECOMPUTED_CDF; ++i) {
71
- tmp *= lambda / (double)i;
72
- prob[i] = prob[i - 1] + tmp;
73
- }
74
- }
75
- }
76
-
77
- double prob[RNG_POISSON_N_PRECOMPUTED_CDF];
78
- double floored_lambda_ = 0.0;
79
- double log_lambda_ = 0.0;
80
- double lgamma_floored_lambda_ = 0.0;
81
- double sqrt_lambda_ = 0.0;
82
- double sqrt_floored_lambda_ = 0.0;
83
- double dx_ = 0.0;
84
- double delta_ = 0.0;
85
- double dpdfl_ = 0.0;
86
- double sqrt_half_dpdfl_ = 0.0;
87
- double inv_dpdfl_ = 0.0;
88
- double c2_add_coeff_ = 0.0;
89
- double c_add_coeff_ = 0.0;
90
- double c1_ = 0.0;
91
- double c2_ = 0.0;
92
- double c3_ = 0.0;
93
- double c4_ = 0.0;
94
- double c5_ = 0.0;
95
- double c_ = 0.0;
96
- static constexpr double exp_one_by_78 = 1.0129030479320018583185514777512983L;
97
- static constexpr double pi_4_ = 0.7853981633974483096156608458198757L;
98
- static constexpr double spi_2_ = 1.2533141373155002512078826424055226L;
99
- };
100
-
101
- template <typename IntType>
102
- class distribution_base<oneapi::mkl::rng::device::poisson<IntType, poisson_method::devroye>> {
103
- public:
104
- struct param_type {
105
- param_type(double lambda) : lambda_(lambda) {}
106
- double lambda_;
107
- };
108
-
109
- distribution_base(double lambda) : lambda_(lambda) {
110
- #ifndef __SYCL_DEVICE_ONLY__
111
- if (lambda_ <= 0.0) {
112
- throw oneapi::mkl::invalid_argument("rng", "poisson", "lambda <= 0");
113
- }
114
- #endif
115
- params_.set_lambda(lambda_);
116
- }
117
-
118
- double lambda() const {
119
- return lambda_;
120
- }
121
-
122
- param_type param() const {
123
- return param_type(lambda_);
124
- }
125
-
126
- void param(const param_type& pt) {
127
- #ifndef __SYCL_DEVICE_ONLY__
128
- if (pt.lambda_ <= 0.0) {
129
- throw oneapi::mkl::invalid_argument("rng", "poisson", "lambda <= 0");
130
- }
131
- #endif
132
- lambda_ = pt.lambda_;
133
- params_.set_lambda(lambda_);
134
- }
135
-
136
- protected:
137
- IntType get_one_num_small_lambdas(double uniform_var) {
138
- IntType res = 0;
139
- if (uniform_var < params_.prob[0]) {
140
- return res;
141
- }
142
- else {
143
- for (res = 1; res < RNG_POISSON_N_PRECOMPUTED_CDF; ++res) {
144
- if (uniform_var < params_.prob[res]) {
145
- return res;
146
- }
147
- }
148
- // in case uniform_var is still bigger than CDF[31] compute additional CDF coefficients
149
- double prob_less_than_k = params_.prob[--res];
150
- double prob_that_k = prob_less_than_k - params_.prob[res - 1];
151
- do {
152
- prob_that_k *= lambda_ / (double)(res++ + 1);
153
- prob_less_than_k += prob_that_k;
154
- } while (uniform_var >= prob_less_than_k);
155
-
156
- return res;
157
- }
158
- }
159
- template <typename EngineType>
160
- IntType get_one_num_med_lambdas(EngineType& engine) {
161
- const double rounding_coeff = (1.0 - std::numeric_limits<double>::epsilon()) / 2.0;
162
- const double max_inttype_val = (std::numeric_limits<IntType>::max)() + rounding_coeff;
163
- double res_;
164
- bool rejection_flag = true;
165
- do {
166
- const double uniform_var = params_.c_ * engine.generate_single(0.0, 1.0);
167
- const double exponential_var = exponential_.generate_single(engine);
168
- double w = 0.0;
169
- if (uniform_var <= params_.c1_) {
170
- const double gaussian_var = gaussian_.generate_single(engine);
171
- const double y = -sycl::fabs(gaussian_var) * params_.sqrt_floored_lambda_ - 1.0;
172
- res_ = sycl::floor(y);
173
- w = -gaussian_var * gaussian_var / 2.0;
174
- if (res_ < -params_.floored_lambda_)
175
- continue;
176
- }
177
- else if (uniform_var <= params_.c2_) {
178
- const double gaussian_var = gaussian_.generate_single(engine);
179
- const double y = 1.0 + sycl::fabs(gaussian_var) * params_.sqrt_half_dpdfl_;
180
- res_ = sycl::ceil(y);
181
- w = y * (2.0 - y) * params_.inv_dpdfl_;
182
- if (res_ > params_.delta_)
183
- continue;
184
- }
185
- else if (uniform_var <= params_.c3_)
186
- res_ = -1.0;
187
- else if (uniform_var <= params_.c4_)
188
- res_ = 0.0;
189
- else if (uniform_var <= params_.c5_)
190
- res_ = 1.0;
191
- else {
192
- const double exponential_var_1 = exponential_.generate_single(engine);
193
- const double y =
194
- params_.delta_ + exponential_var_1 * 2.0 * params_.dpdfl_ / params_.delta_;
195
- res_ = sycl::ceil(y);
196
- w = -params_.delta_ * params_.inv_dpdfl_ * (1.0 + y / 2.0);
197
- }
198
-
199
- rejection_flag = ((w - exponential_var - res_ * params_.log_lambda_) >
200
- (params_.lgamma_floored_lambda_ -
201
- sycl::lgamma(res_ + params_.floored_lambda_ + 1.0)));
202
-
203
- rejection_flag |= (res_ + params_.floored_lambda_) >= max_inttype_val;
204
-
205
- } while (rejection_flag);
206
-
207
- return ((IntType)(res_ + params_.floored_lambda_ + rounding_coeff));
208
- }
209
-
210
- template <typename EngineType>
211
- auto generate(EngineType& engine) ->
212
- typename std::conditional<EngineType::vec_size == 1, IntType,
213
- sycl::vec<IntType, EngineType::vec_size>>::type {
214
- using OutType = typename std::conditional<EngineType::vec_size == 1, IntType,
215
- sycl::vec<IntType, EngineType::vec_size>>::type;
216
- OutType res;
217
- if constexpr (EngineType::vec_size == 1) {
218
- res = 0;
219
- if (lambda_ < RNG_POISSON_LAMBDA_LOW_BOUND) {
220
- double uniform_var = engine.generate(0.0, 1.0);
221
- return get_one_num_small_lambdas(uniform_var);
222
- }
223
- else if (lambda_ < RNG_POISSON_LAMBDA_HUGE_BOUND) {
224
- const double rounding_coeff = (1.0 - std::numeric_limits<double>::epsilon()) / 2.0;
225
- const double max_inttype_val =
226
- (std::numeric_limits<IntType>::max)() + rounding_coeff;
227
- double res_;
228
- bool rejection_flag = true;
229
- do {
230
- const double uniform_var = params_.c_ * engine.generate(0.0, 1.0);
231
- const double exponential_var = exponential_.generate(engine);
232
- double w = 0.0;
233
- if (uniform_var <= params_.c1_) {
234
- const double gaussian_var = gaussian_.generate(engine);
235
- const double y =
236
- -sycl::fabs(gaussian_var) * params_.sqrt_floored_lambda_ - 1.0;
237
- res_ = sycl::floor(y);
238
- w = -gaussian_var * gaussian_var / 2.0;
239
- if (res_ < -params_.floored_lambda_)
240
- continue;
241
- }
242
- else if (uniform_var <= params_.c2_) {
243
- const double gaussian_var = gaussian_.generate(engine);
244
- const double y = 1.0 + sycl::fabs(gaussian_var) * params_.sqrt_half_dpdfl_;
245
- res_ = sycl::ceil(y);
246
- w = y * (2.0 - y) * params_.inv_dpdfl_;
247
- if (res_ > params_.delta_)
248
- continue;
249
- }
250
- else if (uniform_var <= params_.c3_)
251
- res_ = -1.0;
252
- else if (uniform_var <= params_.c4_)
253
- res_ = 0.0;
254
- else if (uniform_var <= params_.c5_)
255
- res_ = 1.0;
256
- else {
257
- const double exponential_var_1 = exponential_.generate(engine);
258
- const double y = params_.delta_ +
259
- exponential_var_1 * 2.0 * params_.dpdfl_ / params_.delta_;
260
- res_ = sycl::ceil(y);
261
- w = -params_.delta_ * params_.inv_dpdfl_ * (1.0 + y / 2.0);
262
- }
263
-
264
- rejection_flag = ((w - exponential_var - res_ * params_.log_lambda_) >
265
- (params_.lgamma_floored_lambda_ -
266
- sycl::lgamma(res_ + params_.floored_lambda_ + 1.0)));
267
-
268
- rejection_flag |= (res_ + params_.floored_lambda_) >= max_inttype_val;
269
-
270
- } while (rejection_flag);
271
-
272
- return ((IntType)(res_ + params_.floored_lambda_ + rounding_coeff));
273
- }
274
- else {
275
- res = static_cast<IntType>(lambda_ +
276
- params_.sqrt_lambda_ * gaussian_.generate(engine));
277
- }
278
- }
279
- else {
280
- if (lambda_ < RNG_POISSON_LAMBDA_LOW_BOUND) {
281
- auto uniform_var = engine.generate(0.0, 1.0);
282
- for (int i = 0; i < EngineType::vec_size; ++i) {
283
- res[i] = get_one_num_small_lambdas(uniform_var[i]);
284
- }
285
- return res;
286
- }
287
- else if (lambda_ < RNG_POISSON_LAMBDA_HUGE_BOUND) {
288
- for (int i = 0; i < EngineType::vec_size; ++i) {
289
- res[i] = get_one_num_med_lambdas(engine);
290
- }
291
- return res;
292
- }
293
- else {
294
- sycl::vec<double, EngineType::vec_size> res_fp =
295
- lambda_ + params_.sqrt_lambda_ * gaussian_.generate(engine);
296
- res_fp = sycl::floor(res_fp);
297
- res = res_fp.template convert<IntType>();
298
- }
299
- }
300
- return res;
301
- }
302
-
303
- template <typename EngineType>
304
- IntType generate_single(EngineType& engine) {
305
- IntType res = 0;
306
- if (lambda_ < RNG_POISSON_LAMBDA_LOW_BOUND) {
307
- double uniform_var = engine.generate_single(0.0, 1.0);
308
- return get_one_num_small_lambdas(uniform_var);
309
- }
310
- else if (lambda_ < RNG_POISSON_LAMBDA_HUGE_BOUND) {
311
- return get_one_num_med_lambdas(engine);
312
- }
313
- else {
314
- res = static_cast<IntType>(lambda_ +
315
- params_.sqrt_lambda_ * gaussian_.generate_single(engine));
316
- }
317
- return res;
318
- }
319
-
320
- distribution_base<oneapi::mkl::rng::device::gaussian<double>> gaussian_ = { 0.0, 1.0 };
321
- distribution_base<oneapi::mkl::rng::device::exponential<double>> exponential_ = { 0.0, 1.0 };
322
- poisson_parameters params_;
323
- double lambda_;
324
- };
325
-
326
- } // namespace oneapi::mkl::rng::device::detail
327
-
328
- #endif // _MKL_RNG_DEVICE_POISSON_IMPL_HPP_
@@ -1,58 +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_DETAIL_DETAIL_TYPES_HPP_
21
- #define _MKL_RNG_DETAIL_DETAIL_TYPES_HPP_
22
-
23
- #include <sycl/sycl.hpp>
24
-
25
- namespace oneapi {
26
- namespace mkl {
27
- namespace rng {
28
- namespace device {
29
-
30
- namespace detail {
31
-
32
- // Type of device
33
- namespace device_type {
34
- struct generic {}; // currently only generic DPC++ version is supported
35
- } // namespace device_type
36
-
37
- // internal structure to specify state of engine for each device
38
- template <typename EngineType, typename DeviceType>
39
- struct engine_state_device {};
40
-
41
- template <typename EngineType>
42
- union engine_state {};
43
-
44
- typedef struct {
45
- std::uint32_t hex[2];
46
- } dp_struct_t;
47
-
48
- typedef struct {
49
- std::uint32_t hex[1];
50
- } sp_struct_t;
51
-
52
- } // namespace detail
53
- } // namespace device
54
- } // namespace rng
55
- } // namespace mkl
56
- } // namespace oneapi
57
-
58
- #endif // _MKL_RNG_DETAIL_DETAIL_TYPES_HPP_
@@ -1,51 +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_UNIFORM_BITS_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_UNIFORM_BITS_IMPL_HPP_
22
-
23
- #include "engine_base.hpp"
24
-
25
- namespace oneapi::mkl::rng::device::detail {
26
-
27
- template <typename UIntType>
28
- class distribution_base<oneapi::mkl::rng::device::uniform_bits<UIntType>> {
29
- protected:
30
- template <typename EngineType>
31
- auto generate(EngineType& engine) ->
32
- typename std::conditional<EngineType::vec_size == 1, UIntType,
33
- sycl::vec<UIntType, EngineType::vec_size>>::type {
34
- static_assert(std::is_same<EngineType, philox4x32x10<EngineType::vec_size>>::value ||
35
- std::is_same<EngineType, mcg59<EngineType::vec_size>>::value,
36
- "oneMKL: uniform_bits works only with philox4x32x10/mcg59 engines");
37
- return engine.template generate_uniform_bits<UIntType>();
38
- }
39
-
40
- template <typename EngineType>
41
- UIntType generate_single(EngineType& engine) {
42
- static_assert(std::is_same<EngineType, philox4x32x10<EngineType::vec_size>>::value ||
43
- std::is_same<EngineType, mcg59<EngineType::vec_size>>::value,
44
- "oneMKL: uniform_bits works only with philox4x32x10/mcg59 engines");
45
- return engine.template generate_single_uniform_bits<UIntType>();
46
- }
47
- };
48
-
49
- } // namespace oneapi::mkl::rng::device::detail
50
-
51
- #endif // _MKL_RNG_DEVICE_UNIFORM_BITS_IMPL_HPP_