Skip to content

Commit

Permalink
Fix review issues.
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
  • Loading branch information
mzient committed Jun 8, 2022
1 parent 1c45b0b commit 30d4b9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions dali/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,6 @@ void daliOutputCopySamples(daliPipelineHandle *pipe_handle, void **dsts, int out
if (ws->OutputIsType<CPUBackend>(output_idx)) {
copy_order = is_pinned ? AccessOrder(stream) : AccessOrder::host();
auto & src = ws->Output<CPUBackend>(output_idx);
if (!host_sync)
wait_order = src.order(); // if the copy order is host, then wait will be no-op
CopyToExternal(dsts, dst_mem_kind, src, copy_order, use_copy_kernel);
if (!host_sync)
wait_order = src.order(); // if the copy order is host, then wait will be no-op
Expand Down
4 changes: 2 additions & 2 deletions dali/c_api/c_api_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ void TestCopyOutput(Method method) {

// This loop is tuned so that if the output buffer is recycled before the asynchronous copy
// finishes, the buffer is clobbered and an error is detected.
// (michalz) Verified on my desktop. The changes in c_api that came with this test
// fix the synchronization problem.
// In order to trigger a failure, remove the `wait_order.wait` at the end of
// daliOutputCopy / daliOutputCopySamples
for (int attempt = 0; attempt < 20; attempt++) {
daliPipelineHandle handle;

Expand Down
2 changes: 1 addition & 1 deletion dali/python/backend_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ enum DALIDataTypePlaceholder {};
* The copy will be scheduled on the provided `cuda_stream` or, if left out, on an internal DALI
* stream.
* If a non-blocking copy is requested, the function will synchronize the source buffer's
* associated access order with the provided stream; otherwie, the function will wait until the
* associated access order with the provided stream; otherwise, the function will wait until the
* copy completes.
*
* @tparam SourceObject a data store on GPUBackend (Tensor, TensorList, TensorVector)
Expand Down

0 comments on commit 30d4b9f

Please sign in to comment.