Skip to content

Commit dd64da8

Browse files
committed
bugfix in terminate function
1 parent 9d35b05 commit dd64da8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/aliceVision/segmentation/segmentation.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,14 @@ bool Segmentation::initialize()
8989

9090
bool Segmentation::terminate()
9191
{
92+
if (_parameters.useGpu)
93+
{
9294
#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ONNX_GPU)
93-
Ort::MemoryInfo mem_info_cuda("Cuda", OrtAllocatorType::OrtArenaAllocator, 0, OrtMemType::OrtMemTypeDefault);
94-
Ort::Allocator cudaAllocator(*_ortSession, mem_info_cuda);
95-
cudaAllocator.Free(_cudaInput);
95+
Ort::MemoryInfo mem_info_cuda("Cuda", OrtAllocatorType::OrtArenaAllocator, 0, OrtMemType::OrtMemTypeDefault);
96+
Ort::Allocator cudaAllocator(*_ortSession, mem_info_cuda);
97+
cudaAllocator.Free(_cudaInput);
9698
#endif
99+
}
97100

98101
return true;
99102
}

0 commit comments

Comments
 (0)