diff --git a/tests/SpotTilesTest.cpp b/tests/SpotTilesTest.cpp index 7da0047a0..d5c2f5d12 100644 --- a/tests/SpotTilesTest.cpp +++ b/tests/SpotTilesTest.cpp @@ -135,6 +135,9 @@ TEST_CASE("SpotTiles_MatchWholeFrame_GPU", "[SpotWidth][GPU]") { const auto upload = [&](Frame &f) -> ImagePreprocessorBuffer & { REQUIRE(cudaMemcpy(device.getGPUBuffer(), f.image.data(), f.image.size() * sizeof(int32_t), cudaMemcpyHostToDevice) == cudaSuccess); + // From pageable memory cudaMemcpy may return before the copy has landed, and the buffer cuts + // its squares on a non-blocking stream that does not wait for the NULL stream. + REQUIRE(cudaDeviceSynchronize() == cudaSuccess); return device; }; CheckFrames(frames, upload, SPOT_TILE_HALF, FOOTPRINT_TILE_HALF);