Skip to content

[REVIEW] Update RMM to throw exceptions - #38

Closed
jrhemstad wants to merge 12 commits into
rapidsai:branch-0.12from
jrhemstad:fex-ext-rmm-try-exception
Closed

jrhemstad wants to merge 12 commits into
rapidsai:branch-0.12from
jrhemstad:fex-ext-rmm-try-exception

Conversation

@jrhemstad

@jrhemstad jrhemstad commented Feb 3, 2019 •

Copy link
Copy Markdown
Contributor

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_alloc for out of memory errors, rmm::cuda_error for CUDA errors unrelated to OOM, and rmm::cnmem_error for cnmem errors

  • Updates all RMM_* macros to throw exceptions when an error is detected

  • Updates 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

@jrhemstad jrhemstad changed the title [WIP] Update RMM to throw exceptions [REVIEW] Update RMM to throw exceptions Feb 5, 2019
@jrhemstad

Copy link
Copy Markdown
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 harrism added the 3 - Ready for review Ready for review by team label Feb 5, 2019

@harrism harrism left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor suggestions.

@@ -0,0 +1,237 @@
/*
* Copyright (c) 2018, NVIDIA CORPORATION.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

2019?

Comment thread include/rmm/detail/exceptions.hpp Resolved

namespace rmm {

struct exception : public std::exception {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No documentation in the base class?

Comment thread include/rmm/rmm.hpp Resolved
Comment thread include/rmm/rmm.hpp Resolved
@harrism harrism added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for review Ready for review by team labels Mar 6, 2019
@raydouglass

Copy link
Copy Markdown
Contributor

rerun tests

@harrism
harrism changed the base branch from branch-0.6 to branch-0.9 June 18, 2019 01:14
@harrism
harrism changed the base branch from branch-0.9 to branch-0.10 August 13, 2019 20:39
@harrism
harrism changed the base branch from branch-0.10 to branch-0.11 October 10, 2019 23:54
@harrism
harrism changed the base branch from branch-0.11 to branch-0.12 December 6, 2019 03:42
@jrhemstad jrhemstad closed this Feb 14, 2020
@jrhemstad jrhemstad mentioned this pull request Feb 14, 2020
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 - Waiting on author Waiting for author to respond to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants