There was an error while loading. Please reload this page.
1 parent 228e1a8 commit 3d95e13Copy full SHA for 3d95e13
THCCachingAllocator.cpp
@@ -276,7 +276,7 @@ struct THCCachingAllocator
276
/** combine previously split blocks */
277
void try_merge_blocks(Block* dst, Block* src, FreeBlocks& free_blocks)
278
{
279
- if (!src || src->allocated) {
+ if (!src || src->allocated || src->event_count > 0) {
280
return;
281
}
282
if (dst->prev == src) {
@@ -386,6 +386,7 @@ struct THCCachingAllocator
386
if (err != cudaSuccess) return err;
387
388
std::set<THCStreamPtr> streams(std::move(block->stream_uses));
389
+ THAssert(block->stream_uses.empty());
390
for (auto it = streams.begin(); it != streams.end(); ++it) {
391
auto& stream = *it;
392
0 commit comments