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

Too many warnings #183

Merged
merged 2 commits into from
Mar 11, 2021
Merged

Conversation

alexander-g
Copy link
Contributor

When a Manager is destroyed, the Manager manually destroys Tensors and Sequences. Then the Tensor and Sequence destructors kick in and want to destroy even more, but there is nothing left to destroy so a warning is issued for every Tensor and Sequence. This is very annoying in interactive Python, esp when having a lot of Tensors.
Also, for anonymous sequences end() is called too often and results in another warning.

Added checks to avoid this.

Copy link
Member

@axsaucedo axsaucedo left a comment

Choose a reason for hiding this comment

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

Thanks - looks good, added comments for parenthesis but other than that looks good to merge

src/Sequence.cpp Outdated
@@ -27,7 +27,8 @@ Sequence::~Sequence()
{
KP_LOG_DEBUG("Kompute Sequence Destructor started");

this->destroy();
if (this->mDevice)
Copy link
Member

Choose a reason for hiding this comment

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

add parenthesis to match style

src/Sequence.cpp Outdated
@@ -81,7 +82,8 @@ void
Sequence::clear()
{
KP_LOG_DEBUG("Kompute Sequence calling clear");
this->end();
if (this->isRecording())
Copy link
Member

Choose a reason for hiding this comment

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

add parenthesis to match style

src/Tensor.cpp Outdated
@@ -28,7 +28,8 @@ Tensor::~Tensor()
KP_LOG_DEBUG("Kompute Tensor destructor started. Type: {}",
this->tensorType());

this->destroy();
if (this->mDevice)
Copy link
Member

Choose a reason for hiding this comment

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

add parenthesis to match style

Copy link
Member

@axsaucedo axsaucedo left a comment

Choose a reason for hiding this comment

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

Nice - thanks

@axsaucedo axsaucedo merged commit 50366c6 into KomputeProject:master Mar 11, 2021
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.

2 participants