Skip to content

Commit

Permalink
Optimization.
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Zientkiewicz <[email protected]>
  • Loading branch information
mzient committed Mar 5, 2024
1 parent 112e89e commit 8a4fab1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/dali/core/mm/async_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,10 @@ class async_pool_resource : public async_memory_resource<Kind>,
bool split = supports_splitting && remainder + min_split_remainder < block_end;
size_t orig_alignment = f->alignment;
size_t split_size = block_size;
if (!stream_id_hint::is_unambiguous())
CUDA_CALL(cudaStreamWaitEvent(stream.get(), f->event));
if (!stream_id_hint::is_unambiguous()) {
if (!f->ready())
CUDA_CALL(cudaStreamWaitEvent(stream.get(), f->event));
}
if (split) {
// Adjust the pending free `f` so that it contains only what remains after
// the block was split.
Expand Down

0 comments on commit 8a4fab1

Please sign in to comment.