diff --git a/sycl/source/detail/bindless_images.cpp b/sycl/source/detail/bindless_images.cpp index e8568dc9f1f5e..5c9e3bf8436ff 100644 --- a/sycl/source/detail/bindless_images.cpp +++ b/sycl/source/detail/bindless_images.cpp @@ -171,7 +171,7 @@ alloc_image_mem(const image_descriptor &desc, const sycl::device &syclDevice, ur_image_format_t urFormat; populate_ur_structs(desc, urDesc, urFormat); - image_mem_handle retHandle; + image_mem_handle retHandle = {}; // Call impl. Adapter->callgetAdapter(); // Call impl. - image_mem_handle individual_image; + image_mem_handle individual_image = {}; Adapter->call( C, Device, mipMem.raw_handle, level, &individual_image.raw_handle); @@ -284,7 +284,7 @@ create_image(image_mem_handle memHandle, const image_descriptor &desc, populate_ur_structs(desc, urDesc, urFormat); // Call impl. - ur_exp_image_mem_native_handle_t urImageHandle; + ur_exp_image_mem_native_handle_t urImageHandle = 0; Adapter ->call( @@ -421,7 +421,7 @@ create_image(void *devPtr, size_t pitch, const bindless_image_sampler &sampler, populate_ur_structs(desc, urDesc, urFormat, pitch); // Call impl. - ur_exp_image_mem_native_handle_t urImageHandle; + ur_exp_image_mem_native_handle_t urImageHandle = 0; Adapter->call( C, Device, reinterpret_cast(devPtr), @@ -550,7 +550,7 @@ image_mem_handle map_external_image_memory(external_mem extMem, ur_exp_external_mem_handle_t urExternalMem{extMem.raw_handle}; - image_mem_handle retHandle; + image_mem_handle retHandle = {}; Adapter->call( C, Device, &urFormat, &urDesc, urExternalMem, &retHandle.raw_handle); @@ -580,7 +580,7 @@ void *map_external_linear_memory(external_mem extMem, uint64_t offset, ur_exp_external_mem_handle_t urExternalMem{extMem.raw_handle}; - void *retMemory; + void *retMemory = nullptr; Adapter->call< sycl::errc::invalid, sycl::detail::UrApiKind::urBindlessImagesMapExternalLinearMemoryExp>( @@ -631,7 +631,7 @@ __SYCL_EXPORT external_semaphore import_external_semaphore( sycl::detail::getSyclObjImpl(syclDevice); ur_device_handle_t Device = DevImpl->getHandleRef(); - ur_exp_external_semaphore_handle_t urExternalSemaphore; + ur_exp_external_semaphore_handle_t urExternalSemaphore = nullptr; ur_exp_file_descriptor_t urFileDescriptor = {}; urFileDescriptor.stype = UR_STRUCTURE_TYPE_EXP_FILE_DESCRIPTOR; urFileDescriptor.fd = externalSemaphoreDesc.external_resource.file_descriptor; @@ -778,7 +778,7 @@ get_image_channel_type(const image_mem_handle memHandle, sycl::detail::getSyclObjImpl(syclContext); const sycl::detail::AdapterPtr &Adapter = CtxImpl->getAdapter(); - ur_image_format_t URFormat; + ur_image_format_t URFormat = {}; Adapter->call( diff --git a/sycl/source/device.cpp b/sycl/source/device.cpp index e1abad8af7927..0fac067c9d81b 100644 --- a/sycl/source/device.cpp +++ b/sycl/source/device.cpp @@ -234,8 +234,8 @@ bool device::ext_oneapi_can_access_peer(const device &peer, return true; } - size_t returnSize; - int value; + size_t returnSize = 0; + int value = 0; ur_exp_peer_info_t UrAttr = [&]() { switch (attr) { diff --git a/sycl/source/handler.cpp b/sycl/source/handler.cpp index f40d71c5620c2..f2b8277f846fb 100644 --- a/sycl/source/handler.cpp +++ b/sycl/source/handler.cpp @@ -1862,7 +1862,12 @@ handler::getCommandGraph() const { if (impl->MGraph) { return impl->MGraph; } - return MQueue->getCommandGraph(); + + if (this->MQueue) + return MQueue->getCommandGraph(); + // We should never reach here. MGraph and MQueue can not be null + // simultaneously. + return nullptr; } void handler::setUserFacingNodeType(ext::oneapi::experimental::node_type Type) { diff --git a/sycl/source/virtual_mem.cpp b/sycl/source/virtual_mem.cpp index 5519a27ed0d19..008ccfeda890b 100644 --- a/sycl/source/virtual_mem.cpp +++ b/sycl/source/virtual_mem.cpp @@ -47,7 +47,7 @@ __SYCL_EXPORT size_t get_mem_granularity(const device &SyclDevice, sycl::detail::getSyclObjImpl(SyclContext); const sycl::detail::AdapterPtr &Adapter = ContextImpl->getAdapter(); #ifndef NDEBUG - size_t InfoOutputSize; + size_t InfoOutputSize = 0; Adapter->call( ContextImpl->getHandleRef(), DeviceImpl->getHandleRef(), GranularityQuery, 0, nullptr, &InfoOutputSize); diff --git a/xpti/include/xpti/xpti_data_types.h b/xpti/include/xpti/xpti_data_types.h index 6696dd21602f2..253171ef31ded 100644 --- a/xpti/include/xpti/xpti_data_types.h +++ b/xpti/include/xpti/xpti_data_types.h @@ -436,7 +436,7 @@ struct payload_t { /// Kernel/lambda/function address const void *code_ptr_va = nullptr; /// Internal bookkeeping slot - do not change. - uint64_t internal; + uint64_t internal = 0; /// Flags indicating whether string name, codepointer, source file and hash /// values are available uint64_t flags = 0;