@@ -61,6 +61,7 @@ splitGridHandles(const GridHandle<BufferT> &handle, const BufferT* other = nullp
6161 updateGridCount<<<1 , 1 , 0 , stream>>> (dst, 0u , 1u , d_dirty);
6262 cudaCheckError ();
6363 cudaCheck (cudaMemcpyAsync (&dirty, d_dirty, sizeof (bool ), cudaMemcpyDeviceToHost, stream));
64+ cudaCheck (cudaStreamSynchronize (stream));
6465 if (dirty) tools::cuda::updateChecksum (dst, CheckMode::Partial, stream);
6566 handles[n] = nanovdb::GridHandle<BufferT>(std::move (buffer));
6667 ptr = util::PtrAdd (ptr, handle.gridSize (n));
@@ -93,6 +94,7 @@ mergeGridHandles(const VectorT<GridHandle<BufferT>> &handles, const BufferT* oth
9394 updateGridCount<<<1 , 1 , 0 , stream>>> (data, counter++, gridCount, d_dirty);
9495 cudaCheckError ();
9596 cudaCheck (cudaMemcpyAsync (&dirty, d_dirty, sizeof (bool ), cudaMemcpyDeviceToHost, stream));
97+ cudaCheck (cudaStreamSynchronize (stream));
9698 if (dirty) tools::cuda::updateChecksum (data, CheckMode::Partial, stream);
9799 dst = util::PtrAdd (dst, h.gridSize (n));
98100 src = util::PtrAdd (src, h.gridSize (n));
0 commit comments