mkl-devel-dpcpp 2025.0.1__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 (94) hide show
  1. {mkl_devel_dpcpp-2025.0.1.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl.lib +0 -0
  2. {mkl_devel_dpcpp-2025.0.1.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_blas_dll.lib +0 -0
  3. mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
  4. {mkl_devel_dpcpp-2025.0.1.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_dll.lib +0 -0
  5. mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
  6. {mkl_devel_dpcpp-2025.0.1.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_rng_dll.lib +0 -0
  7. mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
  8. {mkl_devel_dpcpp-2025.0.1.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/METADATA +4 -3
  9. mkl_devel_dpcpp-2025.2.0.dist-info/RECORD +15 -0
  10. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/bfloat16.hpp +0 -26
  11. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/blas/buffer.hpp +0 -42
  12. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/blas/buffer_decls.hpp +0 -880
  13. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/blas/types.hpp +0 -60
  14. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/blas/usm.hpp +0 -42
  15. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/blas/usm_decls.hpp +0 -1240
  16. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/blas.hpp +0 -33
  17. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/dft.hpp +0 -253
  18. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/dfti.hpp +0 -22
  19. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/exceptions.hpp +0 -110
  20. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/experimental/data_fitting/interpolate.hpp +0 -67
  21. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/experimental/data_fitting/spline_and_data_params.hpp +0 -68
  22. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/experimental/data_fitting/splines.hpp +0 -177
  23. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/experimental/data_fitting.hpp +0 -22
  24. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/export.hpp +0 -25
  25. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/lapack/concepts.hpp +0 -55
  26. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/lapack/exceptions.hpp +0 -75
  27. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/lapack/lapack.hpp +0 -1095
  28. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/lapack/scratchpad.hpp +0 -106
  29. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/lapack.hpp +0 -23
  30. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/detail/engine_base.hpp +0 -48
  31. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/bernoulli_impl.hpp +0 -89
  32. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/beta_impl.hpp +0 -464
  33. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/bits_impl.hpp +0 -71
  34. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/distribution_base.hpp +0 -81
  35. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_base.hpp +0 -43
  36. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_helpers_base.hpp +0 -54
  37. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/exponential_impl.hpp +0 -116
  38. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/gamma_impl.hpp +0 -285
  39. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/gaussian_impl.hpp +0 -270
  40. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/lognormal_impl.hpp +0 -105
  41. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_helpers_impl.hpp +0 -117
  42. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_impl.hpp +0 -223
  43. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_helpers_impl.hpp +0 -118
  44. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_impl.hpp +0 -266
  45. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_helpers_impl.hpp +0 -125
  46. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_impl.hpp +0 -385
  47. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_skip_ahead_matrix.hpp +0 -3668
  48. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_helpers_impl.hpp +0 -141
  49. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_impl.hpp +0 -552
  50. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/poisson_impl.hpp +0 -355
  51. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/types.hpp +0 -58
  52. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_bits_impl.hpp +0 -51
  53. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_impl.hpp +0 -289
  54. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/detail/vm_wrappers.hpp +0 -183
  55. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/distributions.hpp +0 -637
  56. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/engine_helpers.hpp +0 -116
  57. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/engines.hpp +0 -187
  58. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/functions.hpp +0 -59
  59. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device/types.hpp +0 -74
  60. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/device.hpp +0 -29
  61. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/distributions.hpp +0 -1913
  62. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/engines.hpp +0 -788
  63. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng/functions.hpp +0 -163
  64. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/rng.hpp +0 -22
  65. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/spblas/sparse_auxiliary.hpp +0 -111
  66. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/spblas/sparse_operations.hpp +0 -446
  67. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/spblas/sparse_structures.hpp +0 -193
  68. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/spblas.hpp +0 -32
  69. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/stats.hpp +0 -356
  70. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/types.hpp +0 -321
  71. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/buffer.hpp +0 -3529
  72. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/decls.hpp +0 -280
  73. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/detail/decls.hpp +0 -81
  74. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/detail/dispatch.hpp +0 -1059
  75. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/detail/ep.hpp +0 -861
  76. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/detail/ha.hpp +0 -860
  77. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/detail/la.hpp +0 -860
  78. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/detail/rts.hpp +0 -4608
  79. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/detail/scalar.hpp +0 -8963
  80. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/device/vm.hpp +0 -460
  81. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/span.hpp +0 -3813
  82. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm/usm.hpp +0 -3581
  83. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl/vm.hpp +0 -30
  84. mkl_devel_dpcpp-2025.0.1.data/data/Library/include/oneapi/mkl.hpp +0 -34
  85. mkl_devel_dpcpp-2025.0.1.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
  86. mkl_devel_dpcpp-2025.0.1.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
  87. mkl_devel_dpcpp-2025.0.1.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
  88. mkl_devel_dpcpp-2025.0.1.dist-info/RECORD +0 -90
  89. {mkl_devel_dpcpp-2025.0.1.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_data_fitting_dll.lib +0 -0
  90. {mkl_devel_dpcpp-2025.0.1.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_stats_dll.lib +0 -0
  91. {mkl_devel_dpcpp-2025.0.1.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_vm_dll.lib +0 -0
  92. {mkl_devel_dpcpp-2025.0.1.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/LICENSE.txt +0 -0
  93. {mkl_devel_dpcpp-2025.0.1.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/WHEEL +0 -0
  94. {mkl_devel_dpcpp-2025.0.1.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/top_level.txt +0 -0
@@ -1,54 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright 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_ENGINE_HELPERS_BASE_HPP_
21
- #define _MKL_RNG_DEVICE_ENGINE_HELPERS_BASE_HPP_
22
-
23
- #include <sycl/sycl.hpp>
24
-
25
- #include "oneapi/mkl/rng/device/detail/engine_base.hpp"
26
-
27
- namespace oneapi::mkl::rng::device {
28
-
29
- template <typename EngineType>
30
- class engine_accessor;
31
-
32
- namespace detail {
33
-
34
- template <typename EngineType>
35
- class init_kernel {};
36
-
37
- template <typename EngineType>
38
- class init_kernel_ex {};
39
-
40
- template <typename EngineType>
41
- class engine_descriptor_base {};
42
-
43
- template <typename EngineType>
44
- class engine_accessor_base {};
45
-
46
- } // namespace detail
47
- } // namespace oneapi::mkl::rng::device
48
-
49
- #include "oneapi/mkl/rng/device/detail/philox4x32x10_helpers_impl.hpp"
50
- #include "oneapi/mkl/rng/device/detail/mrg32k3a_helpers_impl.hpp"
51
- #include "oneapi/mkl/rng/device/detail/mcg31m1_helpers_impl.hpp"
52
- #include "oneapi/mkl/rng/device/detail/mcg59_helpers_impl.hpp"
53
-
54
- #endif // _MKL_RNG_DEVICE_ENGINE_HELPERS_BASE_HPP_
@@ -1,116 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright 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_EXPONENTIAL_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_EXPONENTIAL_IMPL_HPP_
22
-
23
- #include "vm_wrappers.hpp"
24
-
25
- namespace oneapi::mkl::rng::device::detail {
26
-
27
- template <typename RealType, typename Method>
28
- class distribution_base<oneapi::mkl::rng::device::exponential<RealType, Method>> {
29
- public:
30
- struct param_type {
31
- param_type(RealType a, RealType beta) : a_(a), beta_(beta) {}
32
- RealType a_;
33
- RealType beta_;
34
- };
35
-
36
- distribution_base(RealType a, RealType beta) : a_(a), beta_(beta) {
37
- #ifndef __SYCL_DEVICE_ONLY__
38
- if (beta <= static_cast<RealType>(0.0)) {
39
- throw oneapi::mkl::invalid_argument("rng", "exponential", "beta <= 0");
40
- }
41
- #endif
42
- }
43
-
44
- RealType a() const {
45
- return a_;
46
- }
47
-
48
- RealType beta() const {
49
- return beta_;
50
- }
51
-
52
- param_type param() const {
53
- return param_type(a_, beta_);
54
- }
55
-
56
- void param(const param_type& pt) {
57
- #ifndef __SYCL_DEVICE_ONLY__
58
- if (pt.beta_ <= static_cast<RealType>(0.0)) {
59
- throw oneapi::mkl::invalid_argument("rng", "exponential", "beta <= 0");
60
- }
61
- #endif
62
- a_ = pt.a_;
63
- beta_ = pt.beta_;
64
- }
65
-
66
- protected:
67
- template <typename EngineType>
68
- auto generate(EngineType& engine) ->
69
- typename std::conditional<EngineType::vec_size == 1, RealType,
70
- sycl::vec<RealType, EngineType::vec_size>>::type {
71
- auto res = engine.generate(RealType(0), RealType(1));
72
- if constexpr (EngineType::vec_size == 1) {
73
- res = ln_wrapper(res);
74
- }
75
- else {
76
- for (int i = 0; i < EngineType::vec_size; ++i) {
77
- res[i] = ln_wrapper(res[i]);
78
- }
79
- }
80
- res = a_ - res * beta_;
81
- if constexpr (std::is_same<Method, exponential_method::icdf_accurate>::value) {
82
- res = sycl::fmax(res, a_);
83
- }
84
- return res;
85
- }
86
-
87
- template <typename EngineType>
88
- RealType generate_single(EngineType& engine) {
89
- RealType res = engine.generate_single(RealType(0), RealType(1));
90
- res = ln_wrapper(res);
91
- res = a_ - res * beta_;
92
- if constexpr (std::is_same<Method, exponential_method::icdf_accurate>::value) {
93
- res = sycl::fmax(res, a_);
94
- }
95
- return res;
96
- }
97
-
98
- RealType a_;
99
- RealType beta_;
100
-
101
- friend class distribution_base<
102
- oneapi::mkl::rng::device::poisson<std::int32_t, poisson_method::devroye>>;
103
- friend class distribution_base<
104
- oneapi::mkl::rng::device::poisson<std::uint32_t, poisson_method::devroye>>;
105
- friend class distribution_base<oneapi::mkl::rng::device::gamma<float, gamma_method::marsaglia>>;
106
- friend class distribution_base<
107
- oneapi::mkl::rng::device::gamma<double, gamma_method::marsaglia>>;
108
- friend class distribution_base<
109
- oneapi::mkl::rng::device::gamma<float, gamma_method::marsaglia_accurate>>;
110
- friend class distribution_base<
111
- oneapi::mkl::rng::device::gamma<double, gamma_method::marsaglia_accurate>>;
112
- };
113
-
114
- } // namespace oneapi::mkl::rng::device::detail
115
-
116
- #endif // _MKL_RNG_DEVICE_EXPONENTIAL_IMPL_HPP_
@@ -1,285 +0,0 @@
1
- /*******************************************************************************
2
- * Copyright 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_GAMMA_IMPL_HPP_
21
- #define _MKL_RNG_DEVICE_GAMMA_IMPL_HPP_
22
-
23
- #include "vm_wrappers.hpp"
24
-
25
- namespace oneapi::mkl::rng::device::detail {
26
-
27
- enum class gamma_algorithm { Exponential = 0, Vaduva, EPD_Transform, Marsaglia };
28
-
29
- // 1/3
30
- template <typename DataType>
31
- inline DataType gamma_c1() {
32
- if constexpr (std::is_same_v<DataType, double>)
33
- return 0x1.5555555555555p-2;
34
- else
35
- return 0x1.555556p-2f;
36
- }
37
-
38
- // 0.0331
39
- template <typename DataType>
40
- inline DataType gamma_c2() {
41
- if constexpr (std::is_same_v<DataType, double>)
42
- return 0x1.0f27bb2fec56dp-5;
43
- else
44
- return 0x1.0f27bcp-5f;
45
- }
46
-
47
- // 0.6
48
- template <typename DataType>
49
- inline DataType gamma_c06() {
50
- if constexpr (std::is_same_v<DataType, double>)
51
- return 0x1.3333333333333p-1;
52
- else
53
- return 0x1.333334p-1f;
54
- }
55
-
56
- template <typename RealType, typename Method>
57
- class distribution_base<oneapi::mkl::rng::device::gamma<RealType, Method>> {
58
- public:
59
- struct param_type {
60
- param_type(RealType alpha, RealType a, RealType beta) : alpha_(alpha), a_(a), beta_(beta) {}
61
- RealType alpha_;
62
- RealType a_;
63
- RealType beta_;
64
- };
65
-
66
- distribution_base(RealType alpha, RealType a, RealType beta)
67
- : alpha_(alpha),
68
- a_(a),
69
- beta_(beta),
70
- count_(0) {
71
- set_algorithm();
72
- #ifndef __SYCL_DEVICE_ONLY__
73
- if (alpha <= RealType(0.0)) {
74
- throw oneapi::mkl::invalid_argument("rng", "gamma", "alpha <= 0");
75
- }
76
- else if (beta <= RealType(0.0)) {
77
- throw oneapi::mkl::invalid_argument("rng", "gamma", "beta <= 0");
78
- }
79
- #endif
80
- }
81
-
82
- RealType alpha() const {
83
- return alpha_;
84
- }
85
-
86
- RealType a() const {
87
- return a_;
88
- }
89
-
90
- RealType beta() const {
91
- return beta_;
92
- }
93
-
94
- std::size_t count_rejected_numbers() const {
95
- return count_;
96
- }
97
-
98
- param_type param() const {
99
- return param_type(alpha_, a_, beta_);
100
- }
101
-
102
- void param(const param_type& pt) {
103
- #ifndef __SYCL_DEVICE_ONLY__
104
- if (pt.alpha_ <= RealType(0.0)) {
105
- throw oneapi::mkl::invalid_argument("rng", "gamma", "alpha <= 0");
106
- }
107
- else if (pt.beta_ <= RealType(0.0)) {
108
- throw oneapi::mkl::invalid_argument("rng", "gamma", "beta <= 0");
109
- }
110
- #endif
111
- alpha_ = pt.alpha_;
112
- a_ = pt.a_;
113
- beta_ = pt.beta_;
114
- set_algorithm();
115
- }
116
-
117
- protected:
118
- void set_algorithm() {
119
- if (alpha_ <= RealType(1.0)) {
120
- if (alpha_ == RealType(1.0)) {
121
- algorithm_ = gamma_algorithm::Exponential;
122
- }
123
- else if (alpha_ > gamma_c06<RealType>()) {
124
- algorithm_ = gamma_algorithm::Vaduva;
125
- }
126
- else {
127
- algorithm_ = gamma_algorithm::EPD_Transform;
128
- }
129
- }
130
- else {
131
- algorithm_ = gamma_algorithm::Marsaglia;
132
- }
133
- }
134
-
135
- template <typename T, int vecSize>
136
- inline std::pair<T, T> gauss_BM2_for_Marsaglia(const sycl::vec<T, vecSize>& vec) {
137
- T tmp, sin, cos, gauss_1, gauss_2;
138
- tmp = ln_wrapper(vec[0]);
139
- tmp = sqrt_wrapper(T(-2.0) * tmp);
140
- sin = sincospi_wrapper(T(2) * vec[2], cos);
141
- gauss_1 = (tmp * sin);
142
- gauss_2 = (tmp * cos);
143
- return { gauss_1, gauss_2 };
144
- }
145
-
146
- template <std::int32_t n, typename T, typename EngineType>
147
- T acc_rej_kernel(T& z, EngineType& engine) {
148
- RealType flC, flD;
149
- if (algorithm_ == gamma_algorithm::Vaduva) {
150
- flC = RealType(1.0) / alpha_;
151
- flD = (RealType(1.0) - alpha_) *
152
- exp_wrapper(ln_wrapper(alpha_) * alpha_ / (RealType(1.0) - alpha_));
153
- }
154
- else if (algorithm_ == gamma_algorithm::EPD_Transform) {
155
- flC = RealType(1.0) / alpha_;
156
- flD = (RealType(1.0) - alpha_);
157
- }
158
- else if (algorithm_ == gamma_algorithm::Marsaglia) {
159
- flD = alpha_ - gamma_c1<RealType>();
160
- flC = sqrt_wrapper(RealType(1.0) / (RealType(9.0) * alpha_ - RealType(3.0)));
161
- }
162
-
163
- count_ = 0;
164
- RealType z1, z2, z3, z4;
165
- for (int i = 0; i < n; i++) {
166
- while (1) { // looping until satisfied
167
- if (!flag_) {
168
- z1 = engine.generate_single(RealType(0), RealType(1));
169
- z2 = engine.generate_single(RealType(0), RealType(1));
170
- }
171
-
172
- if (algorithm_ == gamma_algorithm::Vaduva) {
173
- z1 = -ln_wrapper(z1);
174
- z2 = -ln_wrapper(z2);
175
- z[i] = powr_wrapper(z1, flC);
176
- if (z1 + z2 >= z[i] + flD) {
177
- break;
178
- }
179
- }
180
- if (algorithm_ == gamma_algorithm::EPD_Transform) {
181
- z2 = -ln_wrapper(z2);
182
- if (z1 <= flD) {
183
- z[i] = powr_wrapper(z1, flC);
184
- if (z[i] <= z2) {
185
- break;
186
- }
187
- }
188
- else {
189
- z1 = -ln_wrapper((RealType(1.0) - z1) * flC);
190
- z[i] = powr_wrapper(flD + alpha_ * z1, flC);
191
- if (z[i] <= z2 + z1) {
192
- break;
193
- }
194
- }
195
- }
196
- if (algorithm_ == gamma_algorithm::Marsaglia) {
197
- RealType local_uniform_2, local_gauss;
198
- if (!flag_) {
199
- z3 = engine.generate_single(RealType(0), RealType(1));
200
- z4 = engine.generate_single(RealType(0), RealType(1));
201
- auto gauss =
202
- gauss_BM2_for_Marsaglia(sycl::vec<RealType, 4>{ z1, z2, z3, z4 });
203
- local_uniform_2 = z2;
204
- local_gauss = gauss.first;
205
-
206
- saved_uniform_2_ = z4;
207
- saved_gauss_ = gauss.second;
208
- }
209
- else {
210
- local_uniform_2 = saved_uniform_2_;
211
- local_gauss = saved_gauss_;
212
- }
213
- flag_ = !flag_;
214
- z[i] = RealType(1.0) + flC * local_gauss;
215
- if (z[i] > RealType(0.0)) {
216
- z[i] = z[i] * z[i] * z[i];
217
- local_gauss = local_gauss * local_gauss;
218
- if (local_uniform_2 <
219
- RealType(1.0) - gamma_c2<RealType>() * local_gauss * local_gauss) {
220
- z[i] = flD * z[i];
221
- break;
222
- }
223
- else {
224
- RealType local_uniform_1 = ln_wrapper(z[i]);
225
- local_uniform_2 = ln_wrapper(local_uniform_2);
226
- if (local_uniform_2 <
227
- RealType(0.5) * local_gauss +
228
- flD * (RealType(1.0) - z[i] + local_uniform_1)) {
229
- z[i] = flD * z[i];
230
- break;
231
- }
232
- }
233
- }
234
- }
235
- ++count_;
236
- }
237
- }
238
- auto res = a_ + beta_ * z;
239
- if constexpr (std::is_same_v<Method, gamma_method::marsaglia_accurate>) {
240
- if (res < a_)
241
- res = a_;
242
- }
243
- return res;
244
- }
245
-
246
- template <typename EngineType>
247
- auto generate(EngineType& engine) ->
248
- typename std::conditional<EngineType::vec_size == 1, RealType,
249
- sycl::vec<RealType, EngineType::vec_size>>::type {
250
- if (algorithm_ == gamma_algorithm::Exponential) {
251
- distribution_base<oneapi::mkl::rng::device::exponential<RealType>> distr_exp(a_, beta_);
252
- return distr_exp.generate(engine);
253
- }
254
- sycl::vec<RealType, EngineType::vec_size> res{};
255
- res = acc_rej_kernel<EngineType::vec_size>(res, engine);
256
-
257
- return res;
258
- }
259
-
260
- template <typename EngineType>
261
- RealType generate_single(EngineType& engine) {
262
- if (algorithm_ == gamma_algorithm::Exponential) {
263
- distribution_base<oneapi::mkl::rng::device::exponential<RealType>> distr_exp(a_, beta_);
264
- RealType z = distr_exp.generate_single(engine);
265
- return z;
266
- }
267
- sycl::vec<RealType, 1> res{};
268
- res = acc_rej_kernel<1>(res, engine);
269
-
270
- return res[0];
271
- }
272
-
273
- RealType alpha_;
274
- RealType a_;
275
- RealType beta_;
276
- RealType saved_gauss_;
277
- RealType saved_uniform_2_;
278
- bool flag_ = false;
279
- std::size_t count_;
280
- gamma_algorithm algorithm_;
281
- };
282
-
283
- } // namespace oneapi::mkl::rng::device::detail
284
-
285
- #endif // _MKL_RNG_DEVICE_GAMMA_IMPL_HPP_