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

fix(autoware_tensorrt_common): fix bugprone-integer-division #9660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kobayu858
Copy link
Contributor

Description

This is a fix based on clang-tidy bugprone-integer-division error.

/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_common/src/tensorrt_common.cpp:314:43: error: result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
      float gflops = (2 * num_weights) * (dim_in.d[3] / stride * dim_in.d[2] / stride / 1e9);
                                          ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_common/src/tensorrt_common.cpp:339:22: error: result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division,-warnings-as-errors]
      float gflops = dim_in.d[1] * dim_window.d[0] / dim_stride.d[0] * dim_window.d[1] /
                     ^

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: kobayu858 <[email protected]>
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Dec 16, 2024
Copy link

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kobayu858 kobayu858 requested a review from veqcc December 16, 2024 08:55
@kobayu858 kobayu858 added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 16, 2024
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 29.88%. Comparing base (86ba21f) to head (9aece43).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...n/autoware_tensorrt_common/src/tensorrt_common.cpp 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9660      +/-   ##
==========================================
- Coverage   29.88%   29.88%   -0.01%     
==========================================
  Files        1440     1441       +1     
  Lines      108347   108363      +16     
  Branches    42467    42469       +2     
==========================================
+ Hits        32376    32380       +4     
- Misses      72730    72742      +12     
  Partials     3241     3241              
Flag Coverage Δ *Carryforward flag
differential 6.44% <0.00%> (?)
total 29.88% <ø> (+<0.01%) ⬆️ Carriedforward from 86ba21f

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@knzo25 knzo25 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Status: To Triage
Development

Successfully merging this pull request may close these issues.

2 participants