From b42e49ae0bf930a3a991c239000c21688fb69a44 Mon Sep 17 00:00:00 2001 From: Sanjiban Sengupta Date: Wed, 29 Jan 2025 18:06:47 +0100 Subject: [PATCH] fix: index error for total memory chunks --- tmva/sofie/src/RModel.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tmva/sofie/src/RModel.cxx b/tmva/sofie/src/RModel.cxx index e36631fee2144..3e00b6a5aba72 100644 --- a/tmva/sofie/src/RModel.cxx +++ b/tmva/sofie/src/RModel.cxx @@ -374,12 +374,13 @@ std::string RModel::AllocateIntermediateMemory(std::span if (fIntermediateMemoryInfo.total_memory.size()){ auto previous_tensor_idx = fIntermediateMemoryInfo.total_memory.back().chunk_idx; auto previous_tensor_size = fIntermediateMemoryInfo.total_memory.back().tensor_size; + fIntermediateMemoryInfo.total_memory.push_back({ std::string(it), previous_tensor_idx+previous_tensor_size, tensor_size }); - memory_allocation_string += "\nfloat* tensor_"+ std::string(it) + "= reinterpret_cast(fIntermediateMemoryPool+" + previous_tensor_idx+previous_tensor_size + ");\n"; + memory_allocation_string += "\nfloat* tensor_"+ std::string(it) + "= reinterpret_cast(fIntermediateMemoryPool+" + std::to_string(previous_tensor_idx+previous_tensor_size) + ");\n"; } else { fIntermediateMemoryInfo.total_memory.push_back({ std::string(it),