Skip to content

Commit 37b9f73

Browse files
authored
[NFC][opencl-aot] Prevent copies for variables that can be moved. (#19609)
Fixes #18505.
1 parent 100bc95 commit 37b9f73

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

opencl/opencl-aot/source/utils.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,13 @@ getOpenCLPlatform(DeviceType Type) {
171171

172172
std::map<DeviceType, std::vector<std::string>>
173173
DeviceTypesToSupportedPlatformNames{
174-
{cpu, {StrIntelPlatformCommon, StrIntelPlatformCpuRt}},
174+
{cpu, {StrIntelPlatformCommon, std::move(StrIntelPlatformCpuRt)}},
175175
{gpu,
176-
{StrIntelPlatformCommon, StrIntelPlatformNeoHd,
177-
StrIntelPlatformNeoUhd}},
176+
{StrIntelPlatformCommon, std::move(StrIntelPlatformNeoHd),
177+
std::move(StrIntelPlatformNeoUhd)}},
178178
{fpga_fast_emu,
179-
{StrIntelPlatformFastEmu, StrIntelPlatformFastEmuPreview}}};
179+
{std::move(StrIntelPlatformFastEmu),
180+
std::move(StrIntelPlatformFastEmuPreview)}}};
180181

181182
cl_platform_id PlatformId(nullptr);
182183
cl_int CLErr(CL_SUCCESS);
@@ -234,7 +235,7 @@ getOpenCLPlatform(DeviceType Type) {
234235
tie(std::ignore, ErrorMessage, CLErr) = getOpenCLDevice(Platform, Type);
235236
if (!clFailed(CLErr)) {
236237
PlatformId = Platform;
237-
PlatformName = PlatformNameOnLoopIteration;
238+
PlatformName = std::move(PlatformNameOnLoopIteration);
238239
break;
239240
}
240241
}

0 commit comments

Comments
 (0)