Skip to content

Commit

Permalink
bugfix in terminate function
Browse files Browse the repository at this point in the history
  • Loading branch information
demoulinv authored and cbentejac committed Dec 23, 2024
1 parent 4a422f5 commit 0fc2633
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/aliceVision/segmentation/segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ bool Segmentation::initialize()

bool Segmentation::terminate()
{
if (_parameters.useGpu)
{
#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ONNX_GPU)
Ort::MemoryInfo mem_info_cuda("Cuda", OrtAllocatorType::OrtArenaAllocator, 0, OrtMemType::OrtMemTypeDefault);
Ort::Allocator cudaAllocator(*_ortSession, mem_info_cuda);
cudaAllocator.Free(_cudaInput);
Ort::MemoryInfo mem_info_cuda("Cuda", OrtAllocatorType::OrtArenaAllocator, 0, OrtMemType::OrtMemTypeDefault);
Ort::Allocator cudaAllocator(*_ortSession, mem_info_cuda);
cudaAllocator.Free(_cudaInput);
#endif
}

return true;
}
Expand Down

0 comments on commit 0fc2633

Please sign in to comment.