diff --git a/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc b/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc index 67cbc8f5d6f13..5dfdd5f44dd04 100644 --- a/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc +++ b/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc @@ -3315,7 +3315,7 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView // Create function state // TODO: remove default capture NodeComputeInfo compute_info; - compute_info.create_state_func = [=](ComputeContext* context, FunctionState* state) { + compute_info.create_state_func = [=, this](ComputeContext* context, FunctionState* state) { std::unique_ptr p = std::make_unique(); // translate tactic sources string to nvinfer1::TacticSources nvinfer1::TacticSources tactics = 0; @@ -3979,7 +3979,7 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromPrecompiledEngine(con // Create function state // TODO: remove default capture NodeComputeInfo compute_info; - compute_info.create_state_func = [=](ComputeContext* context, FunctionState* state) { + compute_info.create_state_func = [=, this](ComputeContext* context, FunctionState* state) { std::unique_ptr p = std::make_unique(); *p = {context->allocate_func, context->release_func,