Skip to content

Commit cf178f4

Browse files
committed
Reintroduce extract
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 73ed9dd commit cf178f4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sycl/source/detail/kernel_bundle_impl.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,14 @@ class kernel_bundle_impl
414414
}
415415
}
416416

417+
// Move the images from the set to images collection.
418+
// Note: Move iterators do not allow moving from sets, so instead we
419+
// need to call extract.
420+
// https://godbolt.org/z/h3YGoPYbr illustrates this limitation.
417421
DevImages.reserve(DevImages.size() + DevImagesSet.size());
418-
for (auto It = std::make_move_iterator(DevImagesSet.begin()),
419-
End = std::make_move_iterator(DevImagesSet.end());
420-
It != End; ++It)
421-
DevImages.push_back(createSyclObjFromImpl<device_image_plain>(**It));
422+
for (auto It = DevImagesSet.begin(); It != DevImagesSet.end();)
423+
DevImages.push_back(createSyclObjFromImpl<device_image_plain>(
424+
*DevImagesSet.extract(It++).value()));
422425

423426
// Check for conflicting kernels in RTC kernel bundles.
424427
ThrowIfConflictingKernels(DevImages);

0 commit comments

Comments
 (0)