Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add synchronization to read/write operations in image decoder cache #1702

Merged
merged 3 commits into from
Jan 31, 2020

Conversation

jantonguirao
Copy link
Contributor

Signed-off-by: Joaquin Anton janton@nvidia.com

Why we need this PR?

Pick one, remove the rest

  • It fixes a bug in ImageDecoder

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    *Introduced an internal cache stream that it is used to synchronize read/write access
  • Affected modules and functionalities:
    ImageDecoder with cached enabled
  • Key points relevant for the review:
    Usage of CUDA streams/events
  • Validation and testing:
    Existing tests
  • Documentation (including examples):
    NA

JIRA TASK: [Use DALI-XXXX or NA]

Signed-off-by: Joaquin Anton <janton@nvidia.com>
}

ImageCacheBlob::~ImageCacheBlob() {
try {
CUDA_CALL(cudaStreamSynchronize(cache_stream_));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general remark: doing this try/terminate defeats the debugger.

/**
* @brief Synchronizes internal cache CUDA stream with a provided stream before a cache reading
* operation
* @remarks To be called before launching a memory copy from a pointer provided by Get
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also mention here that Add doesn't need extra synchronization.

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1099620]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1099620]: BUILD FAILED

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1099763]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1099763]: BUILD PASSED

@mzient mzient merged commit 53a2f9f into NVIDIA:master Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants