Skip to content

Commit bee1066

Browse files
committed
Always let the backend choose the binary
When there is only one binary available the backend should still choose the binary to avoid misleading cl_error_codes Signed-off-by: hiaselhans <[email protected]>
1 parent cece82e commit bee1066

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,14 +680,12 @@ RTDeviceBinaryImage &ProgramManager::getDeviceImage(OSModuleHandle M,
680680

681681
// Ask the native runtime under the given context to choose the device image
682682
// it prefers.
683-
if (Imgs.size() > 1) {
684-
std::vector<pi_device_binary> RawImgs(Imgs.size());
685-
for (unsigned I = 0; I < Imgs.size(); I++)
686-
RawImgs[I] = const_cast<pi_device_binary>(&Imgs[I]->getRawData());
683+
std::vector<pi_device_binary> RawImgs(Imgs.size());
684+
for (unsigned I = 0; I < Imgs.size(); I++)
685+
RawImgs[I] = const_cast<pi_device_binary>(&Imgs[I]->getRawData());
687686

688-
Ctx->getPlugin().call<PiApiKind::piextDeviceSelectBinary>(
689-
getFirstDevice(Ctx), RawImgs.data(), (cl_uint)RawImgs.size(), &ImgInd);
690-
}
687+
Ctx->getPlugin().call<PiApiKind::piextDeviceSelectBinary>(
688+
getFirstDevice(Ctx), RawImgs.data(), (cl_uint)RawImgs.size(), &ImgInd);
691689
Img = Imgs[ImgInd].get();
692690

693691
if (DbgProgMgr > 0) {

0 commit comments

Comments
 (0)