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
Move error handling to DALI core. #867
Conversation
!build |
CI MESSAGE: [731817]: BUILD STARTED |
include/dali/core/gpu_utils.h
Outdated
|
||
namespace dali { | ||
|
||
class DeviceGuard { | ||
public: | ||
DeviceGuard() { |
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.
what's the point of this?
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.
DeviceGuard without parameter just saves and restores current device, for the sake of subsequent changes, e.g. iterating over all devices and setting them with cudaSetDevice
.
#define FILE_AND_LINE __FILE__ ":" DALI_STR(__LINE__) | ||
|
||
#define DALI_MESSAGE(str)\ | ||
(std::string("[" FILE_AND_LINE "] ") + str + dali::GetStacktrace()) |
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 am wondering: is this creating several temporary strings or just one?
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.
It creates several, but with move semantics it might still be as efficient as +=. The question is: is it?
(std::string("[" FILE_AND_LINE "] ") + str + dali::GetStacktrace()) | ||
|
||
#define DALI_FAIL(str) \ | ||
throw dali::DALIException(DALI_MESSAGE(str)); \ |
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.
this could be a function
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.
Nope. FILE and LINE will lose their meaning.
CI MESSAGE: [731817]: BUILD PASSED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Move dynlink_cuda to core. Add dynlink_cuda static library. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
!build |
CI MESSAGE: [733748]: BUILD STARTED |
CI MESSAGE: [733748]: BUILD PASSED |
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
!build |
CI MESSAGE: [736675]: BUILD STARTED |
CI MESSAGE: [736675]: BUILD PASSED |
* Move error_handling and cuda_utils to dali_core. * Fix hang when something other than `std::exception` is thrown. * Add CUDA error handling. * Move dynlink_cuda to core. * Add dynlink_cuda static library. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
DisplacementFilter
std::exception
s, not juststd::runtime_error
sstd::exception
dynlink_cuda
target to facilitate dynamic linking to libcuda from all executable targets (.so and tests)