From c41ead4892a595ae3d5ed018ee4fe939e0f72bf7 Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Thu, 26 Jan 2023 04:20:33 -0800 Subject: [PATCH] [SYCL][NFC] Assert that devices were found before using them --- sycl/source/detail/program_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/detail/program_impl.cpp b/sycl/source/detail/program_impl.cpp index 4908afd78b43e..59fb15178114e 100644 --- a/sycl/source/detail/program_impl.cpp +++ b/sycl/source/detail/program_impl.cpp @@ -160,8 +160,8 @@ program_impl::program_impl(ContextImplPtr Context, }); SyclContextDevices.erase(NewEnd, SyclContextDevices.end()); MDevices = SyclContextDevices; - RT::PiDevice Device = getSyclObjImpl(MDevices[0])->getHandleRef(); assert(!MDevices.empty() && "No device found for this program"); + RT::PiDevice Device = getSyclObjImpl(MDevices[0])->getHandleRef(); // TODO check build for each device instead cl_program_binary_type BinaryType; Plugin.call(