Skip to content

Commit 05a7f14

Browse files
committed
Implement enqueue_free using detail:free (handle buffers)
1 parent 2507bd8 commit 05a7f14

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sycl/include/syclcompat/memory.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,16 +1010,15 @@ static inline void free(void *ptr, sycl::queue q = get_default_queue()) {
10101010
/// \param events The events to be waited on.
10111011
/// \param q The sycl::queue the memory relates to.
10121012
// Can't be static due to the friend declaration in the memory header.
1013-
// TODO(joe): implement this in terms of detail::dpct_free...
10141013
inline sycl::event enqueue_free(const std::vector<void *> &pointers,
10151014
const std::vector<sycl::event> &events,
10161015
sycl::queue q = get_default_queue()) {
10171016
auto event = q.submit(
1018-
[&pointers, &events, ctxt = q.get_context()](sycl::handler &cgh) {
1017+
[&pointers, &events, &q](sycl::handler &cgh) {
10191018
cgh.depends_on(events);
10201019
cgh.host_task([=]() {
10211020
for (auto p : pointers)
1022-
sycl::free(p, ctxt);
1021+
detail::free(p, q);
10231022
});
10241023
});
10251024
get_current_device().add_event(event);

0 commit comments

Comments
 (0)