Repository navigation
Conversation
… error checking macros to exceptions.hpp.
… get name of error from error code.
…ted unit tests to check for thrown exceptions in error tests.
Contributor
Author
|
@harrism this is ready for you to review. You're going to want to enable "Ignore White space Changes" because one of the files got auto-formatted by VSCode. |
harrism
requested changes
Feb 5, 2019
| @@ -0,0 +1,237 @@ | |||
| /* | |||
| * Copyright (c) 2018, NVIDIA CORPORATION. | |||
|
|
||
| namespace rmm { | ||
|
|
||
| struct exception : public std::exception { |
Member
There was a problem hiding this comment.
No documentation in the base class?
Co-Authored-By: jrhemstad <[email protected]>
Co-Authored-By: jrhemstad <[email protected]>
Contributor
|
rerun tests |
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of relying on returning error codes, this PR updates RMM functions to throw exceptions.
If error codes are still desired, top level APIs can convert exceptions to error codes.
Introduces 3 custom exceptions:
rmm::bad_allocfor out of memory errors,rmm::cuda_errorfor CUDA errors unrelated to OOM, andrmm::cnmem_errorfor cnmem errorsUpdates all
RMM_*macros to throw exceptions when an error is detectedUpdates failure GTests to check that the appropriate exceptions are thrown
RMM Python bindings will need to be updated to Cython and allow for catching C++ exceptions. That can either happen in this PR or another PR. See #40