Skip to content

Commit

Permalink
Merge pull request #1726 from zhaomaosu/avoid-copy
Browse files Browse the repository at this point in the history
[DeviceSanitizer][NFC] Fix Coverity copy_instead_of_move issue
  • Loading branch information
kbenzie authored Jun 7, 2024
2 parents ab94782 + 43d1faf commit a7ee825
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/loader/layers/sanitizer/ur_sanddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue(
*ur_cast<const ur_mem_handle_t *>(pArgValue)))) {
auto KernelInfo = context.interceptor->getKernelInfo(hKernel);
std::scoped_lock<ur_shared_mutex> Guard(KernelInfo->Mutex);
KernelInfo->BufferArgs[argIndex] = MemBuffer;
KernelInfo->BufferArgs[argIndex] = std::move(MemBuffer);
} else {
UR_CALL(
pfnSetArgValue(hKernel, argIndex, argSize, pProperties, pArgValue));
Expand Down Expand Up @@ -1222,7 +1222,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj(
if (auto MemBuffer = context.interceptor->getMemBuffer(hArgValue)) {
auto KernelInfo = context.interceptor->getKernelInfo(hKernel);
std::scoped_lock<ur_shared_mutex> Guard(KernelInfo->Mutex);
KernelInfo->BufferArgs[argIndex] = MemBuffer;
KernelInfo->BufferArgs[argIndex] = std::move(MemBuffer);
} else {
UR_CALL(pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue));
}
Expand Down

0 comments on commit a7ee825

Please sign in to comment.