27
27
28
28
#include < oneapi/mkl/rng/device.hpp>
29
29
30
-
31
30
namespace dpnp ::backend::ext::rng::device::dispatch
32
31
{
33
32
namespace mkl_rng_dev = oneapi::mkl::rng::device;
34
33
35
34
template <typename funcPtrT,
36
- template <typename fnT, typename E, typename T, typename M> typename factory,
35
+ template <typename fnT, typename E, typename T, typename M>
36
+ typename factory,
37
37
int _no_of_engines,
38
38
int _no_of_types,
39
39
int _no_of_methods>
@@ -44,8 +44,10 @@ class Dispatch3DTableBuilder
44
44
const std::vector<funcPtrT> row_per_method () const
45
45
{
46
46
std::vector<funcPtrT> per_method = {
47
- factory<funcPtrT, E, T, mkl_rng_dev::gaussian_method::by_default>{}.get (),
48
- factory<funcPtrT, E, T, mkl_rng_dev::gaussian_method::box_muller2>{}.get (),
47
+ factory<funcPtrT, E, T, mkl_rng_dev::gaussian_method::by_default>{}
48
+ .get (),
49
+ factory<funcPtrT, E, T, mkl_rng_dev::gaussian_method::box_muller2>{}
50
+ .get (),
49
51
};
50
52
assert (per_method.size () == _no_of_methods);
51
53
return per_method;
@@ -54,21 +56,21 @@ class Dispatch3DTableBuilder
54
56
template <typename E>
55
57
auto table_per_type_and_method () const
56
58
{
57
- std::vector<std::vector<funcPtrT>>
58
- table_by_type = { row_per_method<E, bool >(),
59
- row_per_method<E, int8_t >(),
60
- row_per_method<E, uint8_t >(),
61
- row_per_method<E, int16_t >(),
62
- row_per_method<E, uint16_t >(),
63
- row_per_method<E, int32_t >(),
64
- row_per_method<E, uint32_t >(),
65
- row_per_method<E, int64_t >(),
66
- row_per_method<E, uint64_t >(),
67
- row_per_method<E, sycl::half>(),
68
- row_per_method<E, float >(),
69
- row_per_method<E, double >(),
70
- row_per_method<E, std::complex<float >>(),
71
- row_per_method<E, std::complex<double >>()};
59
+ std::vector<std::vector<funcPtrT>> table_by_type = {
60
+ row_per_method<E, bool >(),
61
+ row_per_method<E, int8_t >(),
62
+ row_per_method<E, uint8_t >(),
63
+ row_per_method<E, int16_t >(),
64
+ row_per_method<E, uint16_t >(),
65
+ row_per_method<E, int32_t >(),
66
+ row_per_method<E, uint32_t >(),
67
+ row_per_method<E, int64_t >(),
68
+ row_per_method<E, uint64_t >(),
69
+ row_per_method<E, sycl::half>(),
70
+ row_per_method<E, float >(),
71
+ row_per_method<E, double >(),
72
+ row_per_method<E, std::complex<float >>(),
73
+ row_per_method<E, std::complex<double >>()};
72
74
assert (table_by_type.size () == _no_of_types);
73
75
return table_by_type;
74
76
}
@@ -78,12 +80,15 @@ class Dispatch3DTableBuilder
78
80
~Dispatch3DTableBuilder () = default ;
79
81
80
82
template <std::uint8_t ... VecSizes>
81
- void populate (funcPtrT table[][_no_of_types][_no_of_methods], std::integer_sequence<std::uint8_t , VecSizes...>) const
83
+ void populate (funcPtrT table[][_no_of_types][_no_of_methods],
84
+ std::integer_sequence<std::uint8_t , VecSizes...>) const
82
85
{
83
- const auto map_by_engine = {table_per_type_and_method<mkl_rng_dev::mrg32k3a<VecSizes>>()...,
84
- table_per_type_and_method<mkl_rng_dev::philox4x32x10<VecSizes>>()...,
85
- table_per_type_and_method<mkl_rng_dev::mcg31m1<VecSizes>>()...,
86
- table_per_type_and_method<mkl_rng_dev::mcg59<VecSizes>>()...};
86
+ const auto map_by_engine = {
87
+ table_per_type_and_method<mkl_rng_dev::mrg32k3a<VecSizes>>()...,
88
+ table_per_type_and_method<
89
+ mkl_rng_dev::philox4x32x10<VecSizes>>()...,
90
+ table_per_type_and_method<mkl_rng_dev::mcg31m1<VecSizes>>()...,
91
+ table_per_type_and_method<mkl_rng_dev::mcg59<VecSizes>>()...};
87
92
assert (map_by_engine.size () == _no_of_engines);
88
93
89
94
std::uint16_t engine_id = 0 ;
@@ -101,4 +106,4 @@ class Dispatch3DTableBuilder
101
106
}
102
107
}
103
108
};
104
- } // dpnp::backend::ext::rng::device::dispatch
109
+ } // namespace dpnp::backend::ext::rng::device::dispatch
0 commit comments