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.
- {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl.lib +0 -0
- mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
- {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_dll.lib +0 -0
- mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
- {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_rng_dll.lib +0 -0
- mkl_devel_dpcpp-2025.2.0.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
- {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/METADATA +4 -3
- mkl_devel_dpcpp-2025.2.0.dist-info/RECORD +15 -0
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/bfloat16.hpp +0 -26
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/buffer.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/buffer_decls.hpp +0 -880
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/types.hpp +0 -60
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/usm.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas/usm_decls.hpp +0 -1240
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/blas.hpp +0 -34
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dft/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dft.hpp +0 -254
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/dfti.hpp +0 -22
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/exceptions.hpp +0 -110
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/interpolate.hpp +0 -67
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/spline_and_data_params.hpp +0 -68
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting/splines.hpp +0 -177
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/experimental/data_fitting.hpp +0 -22
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/export.hpp +0 -25
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/concepts.hpp +0 -55
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/exceptions.hpp +0 -75
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/lapack.hpp +0 -1096
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/scratchpad.hpp +0 -107
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/lapack.hpp +0 -24
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/detail/engine_base.hpp +0 -48
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/bernoulli_impl.hpp +0 -89
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/beta_impl.hpp +0 -463
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/bits_impl.hpp +0 -71
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/distribution_base.hpp +0 -85
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_base.hpp +0 -43
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/engine_helpers_base.hpp +0 -54
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/exponential_impl.hpp +0 -116
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/gamma_impl.hpp +0 -285
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/gaussian_impl.hpp +0 -270
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/geometric_impl.hpp +0 -99
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/lognormal_impl.hpp +0 -105
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_helpers_impl.hpp +0 -117
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg31m1_impl.hpp +0 -223
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_helpers_impl.hpp +0 -118
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mcg59_impl.hpp +0 -266
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_helpers_impl.hpp +0 -125
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_impl.hpp +0 -385
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/mrg32k3a_skip_ahead_matrix.hpp +0 -3668
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_helpers_impl.hpp +0 -141
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/philox4x32x10_impl.hpp +0 -552
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/poisson_impl.hpp +0 -328
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/types.hpp +0 -58
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_bits_impl.hpp +0 -51
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_impl.hpp +0 -287
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/vm_wrappers.hpp +0 -183
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/distributions.hpp +0 -700
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/engine_helpers.hpp +0 -116
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/engines.hpp +0 -187
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/functions.hpp +0 -59
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/types.hpp +0 -79
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device.hpp +0 -29
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/distributions.hpp +0 -1913
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/engines.hpp +0 -788
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/functions.hpp +0 -163
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng.hpp +0 -23
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_auxiliary.hpp +0 -111
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_operations.hpp +0 -446
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/sparse_structures.hpp +0 -193
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spblas.hpp +0 -33
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/stats/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/stats.hpp +0 -357
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/types.hpp +0 -321
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/buffer.hpp +0 -3529
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/decls.hpp +0 -280
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/decls.hpp +0 -81
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/dispatch.hpp +0 -1059
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/ep.hpp +0 -861
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/ha.hpp +0 -860
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/la.hpp +0 -860
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/rts.hpp +0 -4608
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/detail/scalar.hpp +0 -8963
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/device/vm.hpp +0 -460
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/span.hpp +0 -3813
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/spec.hpp +0 -42
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm/usm.hpp +0 -3581
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/vm.hpp +0 -31
- mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl.hpp +0 -35
- mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_dft_dll.lib +0 -0
- mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_lapack_dll.lib +0 -0
- mkl_devel_dpcpp-2025.1.0.data/data/Library/lib/mkl_sycl_sparse_dll.lib +0 -0
- mkl_devel_dpcpp-2025.1.0.dist-info/RECORD +0 -99
- {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_blas_dll.lib +0 -0
- {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
- {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_stats_dll.lib +0 -0
- {mkl_devel_dpcpp-2025.1.0.data → mkl_devel_dpcpp-2025.2.0.data}/data/Library/lib/mkl_sycl_vm_dll.lib +0 -0
- {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/LICENSE.txt +0 -0
- {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/WHEEL +0 -0
- {mkl_devel_dpcpp-2025.1.0.dist-info → mkl_devel_dpcpp-2025.2.0.dist-info}/top_level.txt +0 -0
mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/uniform_impl.hpp
DELETED
|
@@ -1,287 +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_UNIFORM_IMPL_HPP_
|
|
21
|
-
#define _MKL_RNG_DEVICE_UNIFORM_IMPL_HPP_
|
|
22
|
-
|
|
23
|
-
#include <limits>
|
|
24
|
-
|
|
25
|
-
#include "engine_base.hpp"
|
|
26
|
-
|
|
27
|
-
namespace oneapi::mkl::rng::device::detail {
|
|
28
|
-
|
|
29
|
-
static inline std::uint64_t umul_hi_64(const std::uint64_t a, const std::uint64_t b) {
|
|
30
|
-
const std::uint64_t a_lo = a & 0xFFFFFFFFULL;
|
|
31
|
-
const std::uint64_t a_hi = a >> 32;
|
|
32
|
-
const std::uint64_t b_lo = b & 0xFFFFFFFFULL;
|
|
33
|
-
const std::uint64_t b_hi = b >> 32;
|
|
34
|
-
|
|
35
|
-
const std::uint64_t ab_hi = a_hi * b_hi;
|
|
36
|
-
const std::uint64_t ab_lo = a_lo * b_lo;
|
|
37
|
-
const std::uint64_t ab_md = a_hi * b_lo;
|
|
38
|
-
const std::uint64_t ba_md = b_hi * a_lo;
|
|
39
|
-
|
|
40
|
-
const std::uint64_t bias = ((ab_md & 0xFFFFFFFFULL) + (ba_md & 0xFFFFFFFFULL) + (ab_lo >> 32)) >> 32;
|
|
41
|
-
|
|
42
|
-
return ab_hi + (ab_md >> 32) + (ba_md >> 32) + bias;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
template <typename EngineType, typename Generator>
|
|
46
|
-
static inline void generate_leftover(std::uint64_t range, Generator generate,
|
|
47
|
-
std::uint64_t& res_64, std::uint64_t& leftover) {
|
|
48
|
-
if constexpr (std::is_same_v<EngineType, mcg31m1<EngineType::vec_size>>) {
|
|
49
|
-
std::uint32_t res_1 = generate();
|
|
50
|
-
std::uint32_t res_2 = generate();
|
|
51
|
-
std::uint32_t res_3 = generate();
|
|
52
|
-
res_64 = (static_cast<std::uint64_t>(res_3) << 62) +
|
|
53
|
-
(static_cast<std::uint64_t>(res_2) << 31) + res_1;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
std::uint32_t res_1 = generate();
|
|
57
|
-
std::uint32_t res_2 = generate();
|
|
58
|
-
res_64 = (static_cast<std::uint64_t>(res_2) << 32) + res_1;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
leftover = res_64 * range;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
template <typename Type, typename Method>
|
|
65
|
-
class distribution_base<oneapi::mkl::rng::device::uniform<Type, Method>> {
|
|
66
|
-
public:
|
|
67
|
-
struct param_type {
|
|
68
|
-
param_type(Type a, Type b) : a_(a), b_(b) {}
|
|
69
|
-
Type a_;
|
|
70
|
-
Type b_;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
distribution_base(Type a, Type b) : a_(a), b_(b) {
|
|
74
|
-
#ifndef __SYCL_DEVICE_ONLY__
|
|
75
|
-
if (a >= b) {
|
|
76
|
-
throw oneapi::mkl::invalid_argument("rng", "uniform", "a >= b");
|
|
77
|
-
}
|
|
78
|
-
#endif
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
Type a() const {
|
|
82
|
-
return a_;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
Type b() const {
|
|
86
|
-
return b_;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
param_type param() const {
|
|
90
|
-
return param_type(a_, b_);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
void param(const param_type& pt) {
|
|
94
|
-
#ifndef __SYCL_DEVICE_ONLY__
|
|
95
|
-
if (pt.a_ >= pt.b_) {
|
|
96
|
-
throw oneapi::mkl::invalid_argument("rng", "uniform", "a >= b");
|
|
97
|
-
}
|
|
98
|
-
#endif
|
|
99
|
-
a_ = pt.a_;
|
|
100
|
-
b_ = pt.b_;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
protected:
|
|
104
|
-
template <typename FpType, typename OutType, typename EngineType>
|
|
105
|
-
OutType generate_single_int(EngineType& engine) {
|
|
106
|
-
sycl::vec<FpType, EngineType::vec_size> res_fp;
|
|
107
|
-
res_fp = engine.generate(static_cast<FpType>(a_), static_cast<FpType>(b_));
|
|
108
|
-
res_fp = sycl::floor(res_fp);
|
|
109
|
-
OutType res = res_fp.template convert<Type>();
|
|
110
|
-
return res;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
template <typename EngineType>
|
|
114
|
-
auto generate(EngineType& engine) ->
|
|
115
|
-
typename std::conditional<EngineType::vec_size == 1, Type,
|
|
116
|
-
sycl::vec<Type, EngineType::vec_size>>::type {
|
|
117
|
-
using OutType = typename std::conditional<EngineType::vec_size == 1, Type,
|
|
118
|
-
sycl::vec<Type, EngineType::vec_size>>::type;
|
|
119
|
-
using FpType =
|
|
120
|
-
typename std::conditional<std::is_same<Method, uniform_method::accurate>::value, double,
|
|
121
|
-
float>::type;
|
|
122
|
-
OutType res;
|
|
123
|
-
if constexpr (std::is_integral<Type>::value) {
|
|
124
|
-
if constexpr (std::is_same_v<Type, std::int32_t> || std::is_same_v<Type, std::uint32_t>) {
|
|
125
|
-
return generate_single_int<FpType, OutType>(engine);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
// Lemire's sample rejection method to exclude bias for uniform numbers
|
|
129
|
-
// https://arxiv.org/abs/1805.10941
|
|
130
|
-
|
|
131
|
-
constexpr std::uint64_t uint_max64 = std::numeric_limits<std::uint64_t>::max();
|
|
132
|
-
constexpr std::uint64_t uint_max32 = std::numeric_limits<std::uint32_t>::max();
|
|
133
|
-
|
|
134
|
-
std::uint64_t range = b_ - a_;
|
|
135
|
-
std::uint64_t threshold = (uint_max64 - range) % range;
|
|
136
|
-
|
|
137
|
-
if (range <= uint_max32)
|
|
138
|
-
return generate_single_int<FpType, OutType>(engine);
|
|
139
|
-
|
|
140
|
-
if constexpr (EngineType::vec_size == 1) {
|
|
141
|
-
std::uint64_t res_64, leftover;
|
|
142
|
-
|
|
143
|
-
generate_leftover<EngineType>(range, [&engine](){return engine.generate();},
|
|
144
|
-
res_64, leftover);
|
|
145
|
-
|
|
146
|
-
if (range == uint_max64)
|
|
147
|
-
return res_64;
|
|
148
|
-
|
|
149
|
-
while (leftover < threshold) {
|
|
150
|
-
generate_leftover<EngineType>(range, [&engine](){return engine.generate();},
|
|
151
|
-
res_64, leftover);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
res = a_ + umul_hi_64(res_64, range);
|
|
155
|
-
|
|
156
|
-
return res;
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
std::uint64_t leftover;
|
|
160
|
-
|
|
161
|
-
sycl::vec<std::uint32_t, EngineType::vec_size> res_1 = engine.generate();
|
|
162
|
-
sycl::vec<std::uint32_t, EngineType::vec_size> res_2 = engine.generate();
|
|
163
|
-
sycl::vec<std::uint64_t, EngineType::vec_size> res_64;
|
|
164
|
-
|
|
165
|
-
if constexpr (std::is_same_v<EngineType, mcg31m1<EngineType::vec_size>>) {
|
|
166
|
-
sycl::vec<std::uint32_t, EngineType::vec_size> res_3 = engine.generate();
|
|
167
|
-
|
|
168
|
-
for (int i = 0; i < EngineType::vec_size; i++) {
|
|
169
|
-
res_64[i] = (static_cast<std::uint64_t>(res_3[i]) << 62) +
|
|
170
|
-
(static_cast<std::uint64_t>(res_2[i]) << 31) + res_1[i];
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
if constexpr (EngineType::vec_size == 3) {
|
|
175
|
-
res_64[0] = (static_cast<std::uint64_t>(res_1[1]) << 32) +
|
|
176
|
-
static_cast<std::uint64_t>(res_1[0]);
|
|
177
|
-
res_64[1] = (static_cast<std::uint64_t>(res_2[0]) << 32) +
|
|
178
|
-
static_cast<std::uint64_t>(res_1[2]);
|
|
179
|
-
res_64[2] = (static_cast<std::uint64_t>(res_2[2]) << 32) +
|
|
180
|
-
static_cast<std::uint64_t>(res_2[1]);
|
|
181
|
-
} else {
|
|
182
|
-
for (int i = 0; i < EngineType::vec_size / 2; i++) {
|
|
183
|
-
res_64[i] = (static_cast<std::uint64_t>(res_1[2 * i + 1]) << 32) +
|
|
184
|
-
static_cast<std::uint64_t>(res_1[2 * i]);
|
|
185
|
-
res_64[i + EngineType::vec_size / 2] = (static_cast<std::uint64_t>(res_2[2 * i + 1]) << 32) +
|
|
186
|
-
static_cast<std::uint64_t>(res_2[2 * i]);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (range == uint_max64)
|
|
192
|
-
return res_64.template convert<Type>();
|
|
193
|
-
|
|
194
|
-
for (int i = 0; i < EngineType::vec_size; i++) {
|
|
195
|
-
leftover = res_64[i] * range;
|
|
196
|
-
|
|
197
|
-
while (leftover < threshold) {
|
|
198
|
-
generate_leftover<EngineType>(range, [&engine](){return engine.generate_single();},
|
|
199
|
-
res_64[i], leftover);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
res[i] = a_ + umul_hi_64(res_64[i], range);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return res;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
res = engine.generate(a_, b_);
|
|
211
|
-
if constexpr (std::is_same<Method, uniform_method::accurate>::value) {
|
|
212
|
-
res = sycl::fmax(res, a_);
|
|
213
|
-
res = sycl::fmin(res, b_);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return res;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
template <typename EngineType>
|
|
221
|
-
Type generate_single(EngineType& engine) {
|
|
222
|
-
using FpType =
|
|
223
|
-
typename std::conditional<std::is_same<Method, uniform_method::accurate>::value, double,
|
|
224
|
-
float>::type;
|
|
225
|
-
Type res;
|
|
226
|
-
if constexpr (std::is_integral<Type>::value) {
|
|
227
|
-
if constexpr (std::is_same_v<Type, std::int32_t> || std::is_same_v<Type, std::uint32_t>) {
|
|
228
|
-
FpType res_fp =
|
|
229
|
-
engine.generate_single(static_cast<FpType>(a_), static_cast<FpType>(b_));
|
|
230
|
-
res_fp = sycl::floor(res_fp);
|
|
231
|
-
res = static_cast<Type>(res_fp);
|
|
232
|
-
return res;
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
// Lemire's sample rejection method to exclude bias for uniform numbers
|
|
236
|
-
// https://arxiv.org/abs/1805.10941
|
|
237
|
-
|
|
238
|
-
constexpr std::uint64_t uint_max64 = std::numeric_limits<std::uint64_t>::max();
|
|
239
|
-
constexpr std::uint64_t uint_max32 = std::numeric_limits<std::uint32_t>::max();
|
|
240
|
-
|
|
241
|
-
std::uint64_t range = b_ - a_;
|
|
242
|
-
std::uint64_t threshold = (uint_max64 - range) % range;
|
|
243
|
-
|
|
244
|
-
if (range <= uint_max32) {
|
|
245
|
-
FpType res_fp =
|
|
246
|
-
engine.generate_single(static_cast<FpType>(a_), static_cast<FpType>(b_));
|
|
247
|
-
res_fp = sycl::floor(res_fp);
|
|
248
|
-
res = static_cast<Type>(res_fp);
|
|
249
|
-
return res;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
std::uint64_t res_64, leftover;
|
|
253
|
-
|
|
254
|
-
generate_leftover<EngineType>(range, [&engine](){return engine.generate_single();},
|
|
255
|
-
res_64, leftover);
|
|
256
|
-
|
|
257
|
-
if (range == uint_max64)
|
|
258
|
-
return res_64;
|
|
259
|
-
|
|
260
|
-
while (leftover < threshold) {
|
|
261
|
-
generate_leftover<EngineType>(range, [&engine](){return engine.generate_single();},
|
|
262
|
-
res_64, leftover);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
res = a_ + umul_hi_64(res_64, range);
|
|
266
|
-
|
|
267
|
-
return res;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
res = engine.generate_single(a_, b_);
|
|
272
|
-
if constexpr (std::is_same<Method, uniform_method::accurate>::value) {
|
|
273
|
-
res = sycl::fmax(res, a_);
|
|
274
|
-
res = sycl::fmin(res, b_);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return res;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
Type a_;
|
|
282
|
-
Type b_;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
} // namespace oneapi::mkl::rng::device::detail
|
|
286
|
-
|
|
287
|
-
#endif // _MKL_RNG_DEVICE_UNIFORM_IMPL_HPP_
|
mkl_devel_dpcpp-2025.1.0.data/data/Library/include/oneapi/mkl/rng/device/detail/vm_wrappers.hpp
DELETED
|
@@ -1,183 +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_VM_WRAPPERS_HPP_
|
|
21
|
-
#define _MKL_RNG_DEVICE_VM_WRAPPERS_HPP_
|
|
22
|
-
|
|
23
|
-
#include <cmath>
|
|
24
|
-
|
|
25
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
26
|
-
#include "oneapi/mkl/vm/device/vm.hpp"
|
|
27
|
-
#endif
|
|
28
|
-
|
|
29
|
-
namespace oneapi::mkl::rng::device::detail {
|
|
30
|
-
|
|
31
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
32
|
-
namespace vm_d = oneapi::mkl::vm::device;
|
|
33
|
-
#endif
|
|
34
|
-
|
|
35
|
-
template <typename DataType>
|
|
36
|
-
static inline DataType sqrt_wrapper(DataType a) {
|
|
37
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
38
|
-
DataType t;
|
|
39
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
40
|
-
vm_d::sqrt(&a, &t, vm_d::mode::ep);
|
|
41
|
-
else
|
|
42
|
-
vm_d::sqrt(&a, &t, vm_d::mode::la);
|
|
43
|
-
return t;
|
|
44
|
-
#else
|
|
45
|
-
return sycl::sqrt(a);
|
|
46
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
template <typename DataType>
|
|
50
|
-
static inline DataType sinpi_wrapper(DataType a) {
|
|
51
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
52
|
-
DataType t;
|
|
53
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
54
|
-
vm_d::sinpi(&a, &t, vm_d::mode::ep);
|
|
55
|
-
else
|
|
56
|
-
vm_d::sinpi(&a, &t, vm_d::mode::la);
|
|
57
|
-
return t;
|
|
58
|
-
#else
|
|
59
|
-
return sycl::sinpi(a);
|
|
60
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
template <typename DataType>
|
|
64
|
-
static inline DataType cospi_wrapper(DataType a) {
|
|
65
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
66
|
-
DataType t;
|
|
67
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
68
|
-
vm_d::cospi(&a, &t, vm_d::mode::ep);
|
|
69
|
-
else
|
|
70
|
-
vm_d::cospi(&a, &t, vm_d::mode::la);
|
|
71
|
-
return t;
|
|
72
|
-
#else
|
|
73
|
-
return sycl::cospi(a);
|
|
74
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
template <typename DataType>
|
|
78
|
-
static inline DataType sincospi_wrapper(DataType a, DataType& b) {
|
|
79
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
80
|
-
DataType t;
|
|
81
|
-
if constexpr (std::is_same_v<DataType, double>) {
|
|
82
|
-
vm_d::sincospi(&a, &t, &b, vm_d::mode::ep);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
vm_d::sincospi(&a, &t, &b, vm_d::mode::la);
|
|
86
|
-
}
|
|
87
|
-
return t;
|
|
88
|
-
#else
|
|
89
|
-
b = sycl::cospi(a);
|
|
90
|
-
return sycl::sinpi(a);
|
|
91
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
template <typename DataType>
|
|
95
|
-
static inline DataType ln_wrapper(DataType a) {
|
|
96
|
-
if (a == DataType(0)) {
|
|
97
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
98
|
-
return -0x1.74385446D71C3P+9; // ln(0.494065e-323) = -744.440072
|
|
99
|
-
else
|
|
100
|
-
return -0x1.9D1DA0P+6f; // ln(0.14012984e-44) = -103.278929
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
104
|
-
DataType t;
|
|
105
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
106
|
-
vm_d::ln(&a, &t, vm_d::mode::ep);
|
|
107
|
-
else
|
|
108
|
-
vm_d::ln(&a, &t, vm_d::mode::la);
|
|
109
|
-
return t;
|
|
110
|
-
#else
|
|
111
|
-
return sycl::log(a);
|
|
112
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
template <typename DataType>
|
|
116
|
-
static inline DataType pow_wrapper(DataType a, DataType b) {
|
|
117
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
118
|
-
DataType t;
|
|
119
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
120
|
-
vm_d::pow(&a, &b, &t, vm_d::mode::ep);
|
|
121
|
-
else
|
|
122
|
-
t = sycl::pow(a, b);
|
|
123
|
-
return t;
|
|
124
|
-
#else
|
|
125
|
-
return sycl::pow(a, b);
|
|
126
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
template <typename DataType>
|
|
130
|
-
static inline DataType powr_wrapper(DataType a, DataType b) {
|
|
131
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
132
|
-
DataType t;
|
|
133
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
134
|
-
vm_d::powr(&a, &b, &t, vm_d::mode::ep);
|
|
135
|
-
else
|
|
136
|
-
t = sycl::powr(a, b);
|
|
137
|
-
return t;
|
|
138
|
-
#else
|
|
139
|
-
return sycl::powr(a, b);
|
|
140
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
template <typename DataType>
|
|
144
|
-
static inline DataType exp_wrapper(DataType a) {
|
|
145
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
146
|
-
DataType t;
|
|
147
|
-
if constexpr (std::is_same_v<DataType, double>)
|
|
148
|
-
vm_d::exp(&a, &t, vm_d::mode::ep);
|
|
149
|
-
else
|
|
150
|
-
t = sycl::exp(a);
|
|
151
|
-
return t;
|
|
152
|
-
#else
|
|
153
|
-
return sycl::exp(a);
|
|
154
|
-
#endif // MKL_RNG_USE_BINARY_CODE
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
#if MKL_RNG_USE_BINARY_CODE
|
|
158
|
-
template <typename RealType>
|
|
159
|
-
inline RealType erf_inv_wrapper(RealType x) {
|
|
160
|
-
if (std::fabs(x) == RealType(1)) {
|
|
161
|
-
if constexpr (std::is_same_v<RealType, float>) {
|
|
162
|
-
return std::copysign(0x1.EA8F96P+1f, x); // ErfInv(0.99999994039) = 3.83250689506
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
return std::copysign(0x1.7744F8F74E94AP+2, x); // ErfInv(0.999999999) = 5.86358474875
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
RealType res{};
|
|
170
|
-
if constexpr (std::is_same_v<RealType, double>) {
|
|
171
|
-
vm_d::erfinv(&x, &res, vm_d::mode::ep);
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
vm_d::erfinv(&x, &res, vm_d::mode::la);
|
|
175
|
-
}
|
|
176
|
-
return res;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
#endif
|
|
180
|
-
|
|
181
|
-
} // namespace oneapi::mkl::rng::device::detail
|
|
182
|
-
|
|
183
|
-
#endif // _MKL_RNG_DEVICE_VM_WRAPPERS_HPP_
|