Skip to content

Commit

Permalink
fix: index error for total memory chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjibansg committed Jan 29, 2025
1 parent f5f0dfa commit b42e49a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tmva/sofie/src/RModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,13 @@ std::string RModel::AllocateIntermediateMemory(std::span<const std::string_view>
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<float*>(fIntermediateMemoryPool+" + previous_tensor_idx+previous_tensor_size + ");\n";
memory_allocation_string += "\nfloat* tensor_"+ std::string(it) + "= reinterpret_cast<float*>(fIntermediateMemoryPool+" + std::to_string(previous_tensor_idx+previous_tensor_size) + ");\n";
} else {
fIntermediateMemoryInfo.total_memory.push_back({
std::string(it),
Expand Down

0 comments on commit b42e49a

Please sign in to comment.