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

Make the custom nvJPEG allocator not throw and return only the status #2443

Merged
merged 2 commits into from Nov 9, 2020

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Nov 6, 2020

Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com

Why we need this PR?

Pick one, remove the rest

  • It makes the custom nvJPEG allocator not throw and return only the status

What happened in this PR?

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

  • What solution was applied:
    make the custom nvJPEG allocator not throw and return only the status
  • Affected modules and functionalities:
    nvJPEG based decoder
  • Key points relevant for the review:
    NA
  • Validation and testing:
    CI
  • Documentation (including examples):
    NA

JIRA TASK: [Use DALI-1721]

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Nov 6, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1770676]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1770676]: BUILD PASSED

Comment on lines 215 to 217
} catch (...) {
*ptr = nullptr;
return cudaErrorMemoryAllocation;
Copy link
Contributor

@mzient mzient Nov 9, 2020

Choose a reason for hiding this comment

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

I don't think we should at least try to return a meaningful status

Suggested change
} catch (...) {
*ptr = nullptr;
return cudaErrorMemoryAllocation;
} catch (const CUDABadAlloc &) {
*ptr = nullptr;
return cudaErrorMemoryAllocation;
} catch (const CUDAError &e) {
*ptr = nullptr;
return e.is_rt_api() ? e.rt_error() : cudaErrorUnknown;
} catch (const std::exception &e) {
// print? should we catch it at all?
*ptr = nullptr;
return cudaErrorUnknown;
} catch (...) {
// Now that's really heavy stuff - print something?
// Should we really catch it?
*ptr = nullptr;
return cudaErrorUnknown;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Nov 9, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1775029]: BUILD STARTED

@NVIDIA NVIDIA deleted a comment from JanuszL Nov 9, 2020
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1775029]: BUILD PASSED

@JanuszL JanuszL merged commit 5a851c6 into NVIDIA:master Nov 9, 2020
@JanuszL JanuszL deleted the cusotm_alloc_no_throw branch November 9, 2020 11:47
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