Skip to content

Commit 426664a

Browse files
authored
[SYCL][L0] Fix build with clang compiler (#5415)
Fixes uninitialized variable warning introduced by 844d7b6: ``` llvm/src/sycl/plugins/level_zero/pi_level_zero.cpp:3474:9: error: variable 'Result' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] PI_CALL(piextUSMHostAlloc(&Ptr, Context, nullptr, Size, Alignment)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
1 parent 21a3142 commit 426664a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3446,7 +3446,7 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
34463446
}
34473447
}
34483448

3449-
pi_result Result;
3449+
pi_result Result = PI_SUCCESS;
34503450
if (DeviceIsIntegrated) {
34513451
if (HostPtrImported) {
34523452
// When HostPtr is imported we use it for the buffer.

0 commit comments

Comments
 (0)