@@ -25,6 +25,9 @@ struct coeff_struct_t {
25
25
};
26
26
27
27
<<<<<<< HEAD
28
+ <<<<<<< HEAD
29
+ =======
30
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
28
31
struct alignas(64 ) coeff_struct_aligned_t {
29
32
std::array<std::array<float , 3 >, 3 > c;
30
33
};
@@ -33,6 +36,7 @@ struct alignas(64) coeff_struct_aligned2_t {
33
36
std::array<std::array<float , 3 >, 3 > c;
34
37
int number;
35
38
};
39
+ <<<<<<< HEAD
36
40
37
41
template <typename T> constexpr T get_coefficients () {
38
42
return {{{{1.0 , 2.0 , 3.0 }, {1.1 , 2.1 , 3.1 }, {1.2 , 2.2 , 3.2 }}}};
@@ -44,17 +48,26 @@ template <> constexpr coeff_t get_coefficients<coeff_t>() {
44
48
coeff_t get_coefficients () {
45
49
return {{{1.0 , 2.0 , 3.0 }, {1.1 , 2.1 , 3.1 }, {1.2 , 2.2 , 3.2 }}};
46
50
}
51
+ =======
52
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
47
53
48
- coeff_struct_t get_coefficient_struct () {
54
+ template < typename T> constexpr T get_coefficients () {
49
55
return {{{{1.0 , 2.0 , 3.0 }, {1.1 , 2.1 , 3.1 }, {1.2 , 2.2 , 3.2 }}}};
50
56
>>>>>>> 6c7a8e6f7 ([SYCL] Add a vector convolution demo of using specialization constants (#747 ))
51
57
}
52
58
59
+ template <> constexpr coeff_t get_coefficients<coeff_t >() {
60
+ return {{{1.0 , 2.0 , 3.0 }, {1.1 , 2.1 , 3.1 }, {1.2 , 2.2 , 3.2 }}};
61
+ }
62
+
53
63
constexpr specialization_id<coeff_t > coeff_id;
54
64
55
65
constexpr specialization_id<coeff_struct_t > coeff_struct_id;
56
66
57
67
<<<<<<< HEAD
68
+ <<<<<<< HEAD
69
+ =======
70
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
58
71
// Represented in the IR as
59
72
// clang-format off
60
73
// { %struct.coeff_struct_aligned_t { %"class.std::array.0" zeroinitializer, [28 x i8] undef } }
@@ -72,8 +85,11 @@ constexpr specialization_id<coeff_struct_aligned_t> coeff_struct_aligned_id;
72
85
// clang-format on
73
86
constexpr specialization_id<coeff_struct_aligned2_t > coeff_struct_aligned_id2;
74
87
88
+ <<<<<<< HEAD
75
89
=======
76
90
>>>>>>> 6c7a8e6f7 ([SYCL] Add a vector convolution demo of using specialization constants (#747 ))
91
+ =======
92
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
77
93
template <typename IN>
78
94
float calc_conv (const coeff_t &coeff, const IN &in, item<2 > item_id) {
79
95
float acc = 0 ;
@@ -103,17 +119,23 @@ void do_conv(buffer<float, 2> in, buffer<float, 2> out, CP coeff_provider) {
103
119
// Set the coefficient of the convolution as constant.
104
120
// This will build a specific kernel the coefficient available as literals.
105
121
<<<<<<< HEAD
122
+ <<<<<<< HEAD
123
+ =======
124
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
106
125
cgh.set_specialization_constant <coeff_id>(get_coefficients<coeff_t >());
107
126
cgh.set_specialization_constant <coeff_struct_id>(
108
127
get_coefficients<coeff_struct_t >());
109
128
cgh.set_specialization_constant <coeff_struct_aligned_id>(
110
129
get_coefficients<coeff_struct_aligned_t >());
111
130
cgh.set_specialization_constant <coeff_struct_aligned_id2>(
112
131
get_coefficients<coeff_struct_aligned2_t >());
132
+ <<<<<<< HEAD
113
133
=======
114
134
cgh.set_specialization_constant <coeff_id>(get_coefficients ());
115
135
cgh.set_specialization_constant <coeff_struct_id>(get_coefficient_struct ());
116
136
>>>>>>> 6c7a8e6f7 ([SYCL] Add a vector convolution demo of using specialization constants (#747 ))
137
+ =======
138
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
117
139
cgh.parallel_for <KernelName>(
118
140
in.get_range (), [=](item<2 > item_id, kernel_handler h) {
119
141
auto coeff = coeff_provider (h);
@@ -175,6 +197,9 @@ int main() {
175
197
compare_result (host_accessor{output, read_only}, expected);
176
198
177
199
<<<<<<< HEAD
200
+ <<<<<<< HEAD
201
+ =======
202
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
178
203
do_conv<class Convolution3 >(input, output, [](kernel_handler &h) {
179
204
return h.get_specialization_constant <coeff_struct_aligned_id>().c ;
180
205
});
@@ -187,8 +212,11 @@ int main() {
187
212
188
213
compare_result (host_accessor{output, read_only}, expected);
189
214
215
+ <<<<<<< HEAD
190
216
=======
191
217
>>>>>>> 6c7a8e6f7 ([SYCL] Add a vector convolution demo of using specialization constants (#747 ))
218
+ =======
219
+ >>>>>>> a621ef9b0 ([SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test (#830 ))
192
220
std::cout << " Good computation!" << std::endl;
193
221
return 0 ;
194
222
}
0 commit comments