Skip to content

Commit ba2bb24

Browse files
committed
fix
Signed-off-by: intwanghao <[email protected]>
1 parent be88160 commit ba2bb24

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

sycl/test-e2e/syclcompat/group_utils/exchange.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
#include <syclcompat/device.hpp>
4040
#include <syclcompat/group_utils.hpp>
41+
#include <syclcompat/memory.hpp>
4142

4243
void StripedToBlockedKernel(int *d_data, const sycl::nd_item<3> &item_ct1,
4344
uint8_t *load_temp_storage,
@@ -138,10 +139,11 @@ bool test_striped_to_blocked() {
138139
std::ostream_iterator<int> Iter(std::cout, ", ");
139140
std::copy(d_data, d_data + 512, Iter);
140141
std::cout << std::endl;
142+
syclcompat::wait_and_free(d_data, q_ct1);
141143
return false;
142144
}
143145
}
144-
146+
syclcompat::wait_and_free(d_data, q_ct1);
145147
std::cout << "test_striped_to_blocked pass\n";
146148
return true;
147149
}
@@ -181,9 +183,11 @@ bool test_blocked_to_striped() {
181183
std::ostream_iterator<int> Iter(std::cout, ", ");
182184
std::copy(d_data, d_data + 512, Iter);
183185
std::cout << std::endl;
186+
syclcompat::wait_and_free(d_data, q_ct1);
184187
return false;
185188
}
186189
}
190+
syclcompat::wait_and_free(d_data, q_ct1);
187191
std::cout << "test_blocked_to_striped pass\n";
188192
return true;
189193
}
@@ -226,10 +230,13 @@ bool test_scatter_to_blocked() {
226230
std::ostream_iterator<int> Iter(std::cout, ", ");
227231
std::copy(d_data, d_data + 512, Iter);
228232
std::cout << std::endl;
233+
syclcompat::wait_and_free(d_data, q_ct1);
234+
syclcompat::wait_and_free(d_rank, q_ct1);
229235
return false;
230236
}
231237
}
232-
238+
syclcompat::wait_and_free(d_data, q_ct1);
239+
syclcompat::wait_and_free(d_rank, q_ct1);
233240
std::cout << "test_scatter_to_blocked pass\n";
234241
return true;
235242
}
@@ -282,9 +289,13 @@ bool test_scatter_to_striped() {
282289
std::ostream_iterator<int> Iter(std::cout, ", ");
283290
std::copy(d_data, d_data + 512, Iter);
284291
std::cout << std::endl;
292+
syclcompat::wait_and_free(d_data, q_ct1);
293+
syclcompat::wait_and_free(d_rank, q_ct1);
285294
return false;
286295
}
287296
}
297+
syclcompat::wait_and_free(d_data, q_ct1);
298+
syclcompat::wait_and_free(d_rank, q_ct1);
288299
std::cout << "test_blocked_to_striped pass\n";
289300
return true;
290301
}

0 commit comments

Comments
 (0)