cuda: avoid unnecessary cudaStreamSynchronize() call

resolves #11511
This commit is contained in:
Alexander Alekhin 2018-05-15 18:38:22 +03:00
parent 3104d2f738
commit f42fca9f49

View File

@ -594,10 +594,11 @@ namespace
StackAllocator::~StackAllocator()
{
cudaStreamSynchronize(stream_);
if (memStack_ != 0)
{
cudaStreamSynchronize(stream_);
memStack_->pool->returnMemStack(memStack_);
}
}
size_t alignUp(size_t what, size_t alignment)