Skip to content

Addressed Coverity issue about handling bools in floor_divide #1374

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

Merged

Conversation

oleksandr-pavlyk
Copy link
Contributor

Coverity flaged floor_divide functor for boolean input types.

114040 [Operands don't affect result] (static_checker_CONSTANT_EXPRESSION_RESULT)
The expression's value does not depend on the operands; often, this represents an inadvertent logic error.

In dpctl::​tensor::​kernels::​floor_divide::​FloorDivideFunctor<bool, bool, signed char>::​operator ()(bool const &, bool const &): An operation with non-constant operands that computes a result with constant value ([CWE-569](http://cwe.mitre.org/data/definitions/569.html))

Wrote dedicated simpler code for handling boolean inputs.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the coverity-floor-divide-operands-do-not-affect-results branch 2 times, most recently from e4bc6d3 to 29c52b4 Compare August 27, 2023 18:59
@oleksandr-pavlyk oleksandr-pavlyk changed the title Addressed coverity issue about handling bools in floor_divide Addressed Coverity issue about handling bools in floor_divide Aug 27, 2023
@github-actions
Copy link

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.6dev4=py310ha25a700_22 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 85.635%. remained the same when pulling 29c52b4 on coverity-floor-divide-operands-do-not-affect-results into 1993eae on master.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 0a3888c into master Aug 28, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the coverity-floor-divide-operands-do-not-affect-results branch August 28, 2023 19:06
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.6dev4=py310ha25a700_31 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

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.

3 participants