Skip to content

Work around false positive in klockwork report #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions dpctl/tensor/libtensor/source/tensor_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,10 @@ copy_usm_ndarray_into_usm_ndarray(dpctl::tensor::usm_ndarray src,
if (both_c_contig || both_f_contig) {
if (src_type_id == dst_type_id) {

sycl::event copy_ev = exec_q.memcpy(
dst_data, src_data, src_nelems * src_elem_size, depends);
sycl::event copy_ev =
exec_q.memcpy(static_cast<void *>(dst_data),
static_cast<const void *>(src_data),
src_nelems * src_elem_size, depends);

// make sure src and dst are not GC-ed before copy_ev is complete
return std::make_pair(
Expand Down Expand Up @@ -1285,8 +1287,10 @@ void copy_numpy_ndarray_into_usm_ndarray(
if (src_type_id == dst_type_id) {
int src_elem_size = npy_src.itemsize();

sycl::event copy_ev = exec_q.memcpy(
dst_data, src_data, src_nelems * src_elem_size, depends);
sycl::event copy_ev =
exec_q.memcpy(static_cast<void *>(dst_data),
static_cast<const void *>(src_data),
src_nelems * src_elem_size, depends);

// wait for copy_ev to complete
copy_ev.wait_and_throw();
Expand Down