-
Notifications
You must be signed in to change notification settings - Fork 607
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
Prevent obtaining handle values from dead unique handles and stream leases. #4346
Conversation
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [6171060]: BUILD STARTED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [6171119]: BUILD STARTED |
include/dali/core/cuda_stream_pool.h
Outdated
} | ||
|
||
/** | ||
* @brief Cannot obtain a valie handle from a temporary CUDAStreamLease |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @brief Cannot obtain a valie handle from a temporary CUDAStreamLease | |
* @brief Cannot obtain a valid handle from a temporary CUDAStreamLease |
*/ | ||
constexpr handle_type get() && = delete; | ||
|
||
/// @brief Make the wrapper usable in most context in which the handle type can be used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// @brief Make the wrapper usable in most context in which the handle type can be used | |
/** | |
* @brief Make the wrapper usable in most context in which the handle type can be used | |
*/ |
/** | ||
* @brief Cannot obtain a valie handle from a temporary CUDAStreamLease | ||
* | ||
* By the time this function returns, the stream is returned to the pool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, if we are at this, we should probably mention, that the user of this API should keep the StreamLease for the duration the stream is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class description describes the object life cycle.
CI MESSAGE: [6171119]: BUILD PASSED |
Signed-off-by: Michal Zientkiewicz michalz@nvidia.com
Category:
Refactoring (Redesign of existing code that doesn't affect functionality)
Description:
Prevents the API user from obtaining a dead handle value from
UniqueHandle
andCUDAStreamLease
by deleting r-value-qualified overloads.Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Tested locally that the misusing code doesn't compile.
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A