Skip to content

Commit cc18f96

Browse files
thedanhoffmanDan Hoffmanggerganov
authored
fix(openvino): explicit memset in buffer_context allocation (#20857)
* fix(openvino): explicit memset in buffer_context allocation * minor --------- Co-authored-by: Dan Hoffman <dhoffman@cyket.net> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
1 parent 84ffd0c commit cc18f96

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ggml/src/ggml-openvino/ggml-openvino.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ struct ggml_backend_openvino_buffer_context {
9797
ov_buffer = std::make_shared<ov::intel_gpu::ocl::USMTensor>(std::move(usm_tensor));
9898
} else {
9999
data = ggml_aligned_malloc(size);
100+
GGML_ASSERT(data);
101+
memset(data, 0, size);
100102
ov_buffer = std::make_shared<ov::Tensor>(ov::element::u8, ov::Shape{size}, data);
101103
}
102104

0 commit comments

Comments
 (0)