From 08f859b460b71eef76a345192c1e658e389613ac Mon Sep 17 00:00:00 2001 From: Illia Silin <98187287+illsilin@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:14:52 -0700 Subject: [PATCH] make code compliant with std=c++20 (#2123) [ROCm/composable_kernel commit: 01cb8379cd9b7ce401085e60b39abde50e7dc734] --- include/ck/library/utility/fill.hpp | 4 ++-- include/ck/library/utility/host_tensor.hpp | 2 +- include/ck_tile/host/fill.hpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ck/library/utility/fill.hpp b/include/ck/library/utility/fill.hpp index 3336041354..35625d142e 100644 --- a/include/ck/library/utility/fill.hpp +++ b/include/ck/library/utility/fill.hpp @@ -94,7 +94,7 @@ struct FillMonotonicSeq template void operator()(ForwardIter first, ForwardIter last) const { - std::generate(first, last, [=, n = init_value_]() mutable { + std::generate(first, last, [=, *this, n = init_value_]() mutable { auto tmp = n; n += step_; return tmp; @@ -150,7 +150,7 @@ struct TransformIntoStructuralSparsity template void operator()(ForwardIter first, ForwardIter last) const { - std::for_each(first, last, [=, idx = 0](T& elem) mutable { + std::for_each(first, last, [=, *this, idx = 0](T& elem) mutable { auto tmp_idx = idx; idx += 1; return elem *= valid_sequences[tmp_idx % (sizeof(valid_sequences) / sizeof(T))]; diff --git a/include/ck/library/utility/host_tensor.hpp b/include/ck/library/utility/host_tensor.hpp index edf58b20b4..2cbca29afc 100644 --- a/include/ck/library/utility/host_tensor.hpp +++ b/include/ck/library/utility/host_tensor.hpp @@ -252,7 +252,7 @@ struct ParallelTensorFunctor std::size_t iw_begin = it * work_per_thread; std::size_t iw_end = std::min((it + 1) * work_per_thread, mN1d); - auto f = [=] { + auto f = [=, *this] { for(std::size_t iw = iw_begin; iw < iw_end; ++iw) { call_f_unpack_args(mF, GetNdIndices(iw)); diff --git a/include/ck_tile/host/fill.hpp b/include/ck_tile/host/fill.hpp index d90c0cf6cf..3f64eb28cd 100644 --- a/include/ck_tile/host/fill.hpp +++ b/include/ck_tile/host/fill.hpp @@ -280,7 +280,7 @@ struct FillMonotonicSeq template void operator()(ForwardIter first, ForwardIter last) const { - std::generate(first, last, [=, n = init_value_]() mutable { + std::generate(first, last, [=, *this, n = init_value_]() mutable { auto tmp = n; if constexpr(std::is_same_v) { @@ -315,7 +315,7 @@ struct FillStepRange template void operator()(ForwardIter first, ForwardIter last) const { - std::generate(first, last, [=, n = start_value_]() mutable { + std::generate(first, last, [=, *this, n = start_value_]() mutable { auto tmp = n; n += step_; if constexpr(IsAscending) @@ -388,7 +388,7 @@ struct AdjustToStructuredSparsity template void operator()(ForwardIter first, ForwardIter last) const { - std::transform(first, last, first, [=, index = start](T val) mutable { + std::transform(first, last, first, [=, *this, index = start](T val) mutable { auto tmp = val * masks[index % (sizeof(masks) / sizeof(int32_t))]; index += 1;