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 compiler warning about signed vs unsigned ints #6053

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

hcho3
Copy link
Contributor

@hcho3 hcho3 commented Aug 29, 2024

src/cpp/src/fil/treelite_import.cu:496:26: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'const int' [-Wsign-compare]
103.2   496 |     ASSERT(leaf_vec_size == model.num_class[0], "treelite model inconsistent");
103.2       |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
103.2 /rapids_triton/build/_deps/cuml-src/cpp/src/fil/treelite_import.cu:516:40: warning: comparison of integer expressions of different signedness: 'const int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
103.2   516 |         ASSERT(model.class_id[tree_id] == tree_id % static_cast<size_t>(model.num_class[0]),
103.2       |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```
src/cpp/src/fil/treelite_import.cu:496:26: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'const int' [-Wsign-compare]
103.2   496 |     ASSERT(leaf_vec_size == model.num_class[0], "treelite model inconsistent");
103.2       |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
103.2 /rapids_triton/build/_deps/cuml-src/cpp/src/fil/treelite_import.cu:516:40: warning: comparison of integer expressions of different signedness: 'const int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
103.2   516 |         ASSERT(model.class_id[tree_id] == tree_id % static_cast<size_t>(model.num_class[0]),
103.2       |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
@hcho3 hcho3 requested a review from a team as a code owner August 29, 2024 21:49
@hcho3 hcho3 added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 29, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (branch-24.10@2f11570). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-24.10    #6053   +/-   ##
===============================================
  Coverage                ?   67.06%           
===============================================
  Files                   ?      195           
  Lines                   ?    12920           
  Branches                ?        0           
===============================================
  Hits                    ?     8665           
  Misses                  ?     4255           
  Partials                ?        0           

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

@divyegala
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit d00c1b1 into branch-24.10 Sep 3, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CUDA/C++ improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants