-
Notifications
You must be signed in to change notification settings - Fork 217
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
Fix Coverity hits for covariance, correlation and cosine distances #3017
Closed
avolkov-intel
wants to merge
3
commits into
uxlfoundation:main
from
avolkov-intel:dev/anatolyv/fix-coverity-batch-container
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,8 +126,9 @@ class DAAL_EXPORT InputIface : public daal::algorithms::Input | |
{ | ||
public: | ||
InputIface(size_t nElements) : daal::algorithms::Input(nElements) {} | ||
InputIface(const InputIface & other) : daal::algorithms::Input(other) {} | ||
virtual size_t getNumberOfFeatures() const = 0; | ||
InputIface(const InputIface & other) = default; | ||
InputIface & operator=(const InputIface & other) = default; | ||
virtual size_t getNumberOfFeatures() const = 0; | ||
virtual ~InputIface() {} | ||
}; | ||
|
||
|
@@ -139,7 +140,8 @@ class DAAL_EXPORT Input : public InputIface | |
{ | ||
public: | ||
Input(); | ||
Input(const Input & other) : InputIface(other) {} | ||
Input(const Input & other) = default; | ||
Input & operator=(const Input & other) = default; | ||
|
||
virtual ~Input() {} | ||
|
||
|
@@ -279,6 +281,12 @@ struct DAAL_EXPORT OnlineParameter : public Parameter | |
*/ | ||
OnlineParameter(const OnlineParameter & other); | ||
|
||
/** | ||
* Copy-assignment operator for parameters of the Covariance Online algorithm | ||
* \param[in] other Parameters of the Covariance Online algorithm | ||
*/ | ||
OnlineParameter & operator=(const OnlineParameter & other); | ||
|
||
/** | ||
* Check the correctness of the %OnlineParameter object | ||
*/ | ||
|
@@ -380,7 +388,8 @@ class DAAL_EXPORT DistributedInput<step1Local> : public Input | |
{ | ||
public: | ||
DistributedInput() : Input() {} | ||
DistributedInput(const DistributedInput & other) : Input(other) {} | ||
DistributedInput(const DistributedInput & other) = default; | ||
DistributedInput & operator=(const DistributedInput & other) = default; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As for this class I can't find a respective cpp with implementation, so I'm not sure if we can move the implementation of this functions from here. I don't understand the purpose of DistributedInput maybe it should removed in the future |
||
|
||
virtual ~DistributedInput() {} | ||
}; | ||
|
@@ -395,7 +404,8 @@ class DAAL_EXPORT DistributedInput<step2Master> : public InputIface | |
{ | ||
public: | ||
DistributedInput(); | ||
DistributedInput(const DistributedInput & other) : InputIface(other) {} | ||
DistributedInput(const DistributedInput & other) = default; | ||
DistributedInput & operator=(const DistributedInput & other) = default; | ||
|
||
virtual ~DistributedInput() {} | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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 sort of thing (adding definitions in headers that get compiled for different instruction sets) was causing 'illegal intruction' errors in the CI:
#3012
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.
Here, I only did this in places where constructor was already defined in header
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 looks like this method (L130) wasn't there before:
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.
Yeah, but copy-constructor was already defined in header, so I think defining copy-assignment operator here wouldn't change anything
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.
Perhaps @Vika-F could provide some perspective here.