Skip to content

Commit 02bc932

Browse files
[SYCL][NFC] Assert that devices were found before using them (#8108)
1 parent 9008a5d commit 02bc932

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/source/detail/program_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ program_impl::program_impl(ContextImplPtr Context,
160160
});
161161
SyclContextDevices.erase(NewEnd, SyclContextDevices.end());
162162
MDevices = SyclContextDevices;
163-
RT::PiDevice Device = getSyclObjImpl(MDevices[0])->getHandleRef();
164163
assert(!MDevices.empty() && "No device found for this program");
164+
RT::PiDevice Device = getSyclObjImpl(MDevices[0])->getHandleRef();
165165
// TODO check build for each device instead
166166
cl_program_binary_type BinaryType;
167167
Plugin.call<PiApiKind::piProgramGetBuildInfo>(

0 commit comments

Comments
 (0)