diff --git a/dpctl/tensor/libtensor/source/triul_ctor.cpp b/dpctl/tensor/libtensor/source/triul_ctor.cpp index 24bf7b322f..be5788dcdc 100644 --- a/dpctl/tensor/libtensor/source/triul_ctor.cpp +++ b/dpctl/tensor/libtensor/source/triul_ctor.cpp @@ -22,11 +22,14 @@ /// This file defines functions of dpctl.tensor._tensor_impl extensions //===--------------------------------------------------------------------===// -#include -#include +#include // for std::copy +#include // for std::size_t +#include // for std::make_shared +#include // for std::runtime_error +#include // for std::pair, std::move +#include // for std::vector, std::begin, std::end + #include -#include -#include #include "dpctl4pybind11.hpp" #include @@ -206,7 +209,8 @@ usm_ndarray_triul(sycl::queue &exec_q, const auto &ctx = exec_q.get_context(); using dpctl::tensor::alloc_utils::sycl_free_noexcept; cgh.host_task( - [shp_host_shape_and_strides, dev_shape_and_strides, ctx]() { + [shp_host_shape_and_strides = std::move(shp_host_shape_and_strides), + dev_shape_and_strides, ctx]() { // capture of shp_host_shape_and_strides ensure the underlying // vector exists for the entire execution of copying kernel sycl_free_noexcept(dev_shape_and_strides, ctx);