Skip to content

Commit

Permalink
[OpenMP][NFC] Remove std::move to silence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoerfert committed Nov 21, 2023
1 parent 3e6ae77 commit 6663df3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2700,20 +2700,20 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
// Allocate and construct the AMDGPU kernel.
AMDGPUKernelTy AMDGPUKernel(Name);
if (auto Err = AMDGPUKernel.init(*this, Image))
return std::move(Err);
return Err;

AsyncInfoWrapperTy AsyncInfoWrapper(*this, nullptr);

KernelArgsTy KernelArgs = {};
if (auto Err = AMDGPUKernel.launchImpl(*this, /*NumThread=*/1u,
/*NumBlocks=*/1ul, KernelArgs,
/*Args=*/nullptr, AsyncInfoWrapper))
return std::move(Err);
return Err;

Error Err = Plugin::success();
AsyncInfoWrapper.finalize(Err);

return std::move(Err);
return Err;
}

/// Envar for controlling the number of HSA queues per device. High number of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ Error GenericDeviceTy::init(GenericPluginTy &Plugin) {
Error GenericDeviceTy::deinit(GenericPluginTy &Plugin) {
for (DeviceImageTy *Image : LoadedImages)
if (auto Err = callGlobalDestructors(Plugin, *Image))
return std::move(Err);
return Err;

if (OMPX_DebugKind.get() & uint32_t(DeviceDebugKind::AllocationTracker)) {
GenericGlobalHandlerTy &GHandler = Plugin.getGlobalHandler();
Expand Down
14 changes: 7 additions & 7 deletions openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1106,46 +1106,46 @@ struct CUDADeviceTy : public GenericDeviceTy {
for (auto [Name, Priority] : Funcs) {
GlobalTy FunctionAddr(Name.str(), sizeof(void *), &FunctionPtrs[Idx++]);
if (auto Err = Handler.readGlobalFromDevice(*this, Image, FunctionAddr))
return std::move(Err);
return Err;
}

// Copy the local buffer to the device.
if (auto Err = dataSubmit(GlobalPtrStart, FunctionPtrs.data(),
FunctionPtrs.size() * sizeof(void *), nullptr))
return std::move(Err);
return Err;

// Copy the created buffer to the appropriate symbols so the kernel can
// iterate through them.
GlobalTy StartGlobal(IsCtor ? "__init_array_start" : "__fini_array_start",
sizeof(void *), &GlobalPtrStart);
if (auto Err = Handler.writeGlobalToDevice(*this, Image, StartGlobal))
return std::move(Err);
return Err;

GlobalTy StopGlobal(IsCtor ? "__init_array_end" : "__fini_array_end",
sizeof(void *), &GlobalPtrStop);
if (auto Err = Handler.writeGlobalToDevice(*this, Image, StopGlobal))
return std::move(Err);
return Err;

CUDAKernelTy CUDAKernel(KernelName);

if (auto Err = CUDAKernel.init(*this, Image))
return std::move(Err);
return Err;

AsyncInfoWrapperTy AsyncInfoWrapper(*this, nullptr);

KernelArgsTy KernelArgs = {};
if (auto Err = CUDAKernel.launchImpl(*this, /*NumThread=*/1u,
/*NumBlocks=*/1ul, KernelArgs, nullptr,
AsyncInfoWrapper))
return std::move(Err);
return Err;

Error Err = Plugin::success();
AsyncInfoWrapper.finalize(Err);

if (free(Buffer, TARGET_ALLOC_DEVICE) != OFFLOAD_SUCCESS)
return Plugin::error("Failed to free memory for global buffer");

return std::move(Err);
return Err;
}

/// Stream manager for CUDA streams.
Expand Down

0 comments on commit 6663df3

Please sign in to comment.