@@ -158,13 +158,15 @@ getSyncCommandListForCopy(ur_context_handle_t hContext,
158158
159159static ur_result_t synchronousZeCopy (ur_context_handle_t hContext,
160160 ur_device_handle_t hDevice, void *dst,
161- const void *src, size_t size) {
161+ const void *src, size_t size) try {
162162 auto commandList = getSyncCommandListForCopy (hContext, hDevice);
163163
164164 ZE2UR_CALL (zeCommandListAppendMemoryCopy,
165165 (commandList.get (), dst, src, size, nullptr , 0 , nullptr ));
166166
167167 return UR_RESULT_SUCCESS;
168+ } catch (...) {
169+ return exceptionToResult (std::current_exception ());
168170}
169171
170172void *ur_discrete_buffer_handle_t ::allocateOnDevice(ur_device_handle_t hDevice,
@@ -414,20 +416,20 @@ void *ur_mem_sub_buffer_t::getDevicePtr(
414416 ur_device_handle_t hDevice, device_access_mode_t access, size_t offset,
415417 size_t size, std::function<void (void *src, void *dst, size_t )> migrate) {
416418 return hParent->getBuffer ()->getDevicePtr (
417- hDevice, access, offset + this ->offset , size, migrate);
419+ hDevice, access, offset + this ->offset , size, std::move ( migrate) );
418420}
419421
420422void *ur_mem_sub_buffer_t ::mapHostPtr(
421423 ur_map_flags_t flags, size_t offset, size_t size,
422424 std::function<void (void *src, void *dst, size_t )> migrate) {
423425 return hParent->getBuffer ()->mapHostPtr (flags, offset + this ->offset , size,
424- migrate);
426+ std::move ( migrate) );
425427}
426428
427429void ur_mem_sub_buffer_t::unmapHostPtr (
428430 void *pMappedPtr,
429431 std::function<void (void *src, void *dst, size_t )> migrate) {
430- return hParent->getBuffer ()->unmapHostPtr (pMappedPtr, migrate);
432+ return hParent->getBuffer ()->unmapHostPtr (pMappedPtr, std::move ( migrate) );
431433}
432434
433435ur_shared_mutex &ur_mem_sub_buffer_t ::getMutex() {
0 commit comments