Skip to content

Commit 4c1557f

Browse files
authored
[SYCL][UR][L0 v2] fix wait_list_view construction (#18209)
getWaitListView assumed that calling data() on ane empty vector will return nullptr - this is not guaranteed. This lead to assert in operator bool() trigerring. Implement a constructor for wait_list_view that will set the handles to NULL if num is 0.
1 parent d686aa3 commit 4c1557f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

unified-runtime/source/adapters/level_zero/v2/command_list_manager.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ struct wait_list_view {
2020
ze_event_handle_t *handles;
2121
uint32_t num;
2222

23+
wait_list_view(ze_event_handle_t *handles, uint32_t num)
24+
: handles(num > 0 ? handles : nullptr), num(num) {}
25+
2326
operator bool() const {
2427
assert((handles != nullptr) == (num > 0));
25-
return handles != nullptr;
28+
return num > 0;
2629
}
2730

2831
void clear() {

0 commit comments

Comments
 (0)