26
26
#pragma once
27
27
28
28
#include < complex>
29
+ #include < cstdint>
29
30
#include < type_traits>
30
31
31
32
#include < sycl/sycl.hpp>
@@ -69,14 +70,14 @@ class DispatchTableBuilder
69
70
{
70
71
std::vector<funcPtrT> per_dstTy = {
71
72
factory<funcPtrT, dstTy, bool >{}.get (),
72
- factory<funcPtrT, dstTy, int8_t >{}.get (),
73
- factory<funcPtrT, dstTy, uint8_t >{}.get (),
74
- factory<funcPtrT, dstTy, int16_t >{}.get (),
75
- factory<funcPtrT, dstTy, uint16_t >{}.get (),
76
- factory<funcPtrT, dstTy, int32_t >{}.get (),
77
- factory<funcPtrT, dstTy, uint32_t >{}.get (),
78
- factory<funcPtrT, dstTy, int64_t >{}.get (),
79
- factory<funcPtrT, dstTy, uint64_t >{}.get (),
73
+ factory<funcPtrT, dstTy, std:: int8_t >{}.get (),
74
+ factory<funcPtrT, dstTy, std:: uint8_t >{}.get (),
75
+ factory<funcPtrT, dstTy, std:: int16_t >{}.get (),
76
+ factory<funcPtrT, dstTy, std:: uint16_t >{}.get (),
77
+ factory<funcPtrT, dstTy, std:: int32_t >{}.get (),
78
+ factory<funcPtrT, dstTy, std:: uint32_t >{}.get (),
79
+ factory<funcPtrT, dstTy, std:: int64_t >{}.get (),
80
+ factory<funcPtrT, dstTy, std:: uint64_t >{}.get (),
80
81
factory<funcPtrT, dstTy, sycl::half>{}.get (),
81
82
factory<funcPtrT, dstTy, float >{}.get (),
82
83
factory<funcPtrT, dstTy, double >{}.get (),
@@ -93,24 +94,24 @@ class DispatchTableBuilder
93
94
void populate_dispatch_table (funcPtrT table[][_num_types]) const
94
95
{
95
96
const auto map_by_dst_type = {row_per_dst_type<bool >(),
96
- row_per_dst_type<int8_t >(),
97
- row_per_dst_type<uint8_t >(),
98
- row_per_dst_type<int16_t >(),
99
- row_per_dst_type<uint16_t >(),
100
- row_per_dst_type<int32_t >(),
101
- row_per_dst_type<uint32_t >(),
102
- row_per_dst_type<int64_t >(),
103
- row_per_dst_type<uint64_t >(),
97
+ row_per_dst_type<std:: int8_t >(),
98
+ row_per_dst_type<std:: uint8_t >(),
99
+ row_per_dst_type<std:: int16_t >(),
100
+ row_per_dst_type<std:: uint16_t >(),
101
+ row_per_dst_type<std:: int32_t >(),
102
+ row_per_dst_type<std:: uint32_t >(),
103
+ row_per_dst_type<std:: int64_t >(),
104
+ row_per_dst_type<std:: uint64_t >(),
104
105
row_per_dst_type<sycl::half>(),
105
106
row_per_dst_type<float >(),
106
107
row_per_dst_type<double >(),
107
108
row_per_dst_type<std::complex<float >>(),
108
109
row_per_dst_type<std::complex<double >>()};
109
110
assert (map_by_dst_type.size () == _num_types);
110
111
int dst_id = 0 ;
111
- for (auto &row : map_by_dst_type) {
112
+ for (const auto &row : map_by_dst_type) {
112
113
int src_id = 0 ;
113
- for (auto &fn_ptr : row) {
114
+ for (const auto &fn_ptr : row) {
114
115
table[dst_id][src_id] = fn_ptr;
115
116
++src_id;
116
117
}
@@ -139,22 +140,22 @@ class DispatchVectorBuilder
139
140
void populate_dispatch_vector (funcPtrT vector[]) const
140
141
{
141
142
const auto fn_map_by_type = {func_per_type<bool >(),
142
- func_per_type<int8_t >(),
143
- func_per_type<uint8_t >(),
144
- func_per_type<int16_t >(),
145
- func_per_type<uint16_t >(),
146
- func_per_type<int32_t >(),
147
- func_per_type<uint32_t >(),
148
- func_per_type<int64_t >(),
149
- func_per_type<uint64_t >(),
143
+ func_per_type<std:: int8_t >(),
144
+ func_per_type<std:: uint8_t >(),
145
+ func_per_type<std:: int16_t >(),
146
+ func_per_type<std:: uint16_t >(),
147
+ func_per_type<std:: int32_t >(),
148
+ func_per_type<std:: uint32_t >(),
149
+ func_per_type<std:: int64_t >(),
150
+ func_per_type<std:: uint64_t >(),
150
151
func_per_type<sycl::half>(),
151
152
func_per_type<float >(),
152
153
func_per_type<double >(),
153
154
func_per_type<std::complex<float >>(),
154
155
func_per_type<std::complex<double >>()};
155
156
assert (fn_map_by_type.size () == _num_types);
156
157
int ty_id = 0 ;
157
- for (auto &fn : fn_map_by_type) {
158
+ for (const auto &fn : fn_map_by_type) {
158
159
vector[ty_id] = fn;
159
160
++ty_id;
160
161
}
0 commit comments