Skip to content

[CUDA] Fix cuda 12.8 build warnings - #26136

Merged
tianleiwu merged 2 commits into
mainfrom
tlwu/fix_cuda_12.8_build_v2
Sep 24, 2025
Merged

[CUDA] Fix cuda 12.8 build warnings#26136
tianleiwu merged 2 commits into
mainfrom
tlwu/fix_cuda_12.8_build_v2

Conversation

@tianleiwu

@tianleiwu tianleiwu commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

Fix build warnings using cuda 12.8 in Linux like the following:

<command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]

gather_block_quantized.cc:95:40: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
   95 |   for (int64_t i = gather_axis_ + 1; i < data_rank; ++i) {

attention_op_test.cc:304:85: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<float>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  304 |     } else if (batch_size * q_num_heads * q_sequence_length * total_sequence_length == attn_mask.size()) {
  
  /cast_op_test.cc:1487:24: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
 1487 |   for (size_t i = 0; i < num_pairs; ++i) {
      |                      ~~^~~~~~~~~~~     

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can commit the suggested changes from lintrunner.

Comment thread tools/python/util/vcpkg_helpers.py Outdated
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@tianleiwu
tianleiwu merged commit ad32f42 into main Sep 24, 2025
97 of 98 checks passed
@tianleiwu
tianleiwu deleted the tlwu/fix_cuda_12.8_build_v2 branch September 24, 2025 17:04
fs-eire pushed a commit that referenced this pull request Oct 24, 2025
Fix build warnings using cuda 12.8 in Linux like the following:
```
<command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]

gather_block_quantized.cc:95:40: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
   95 |   for (int64_t i = gather_axis_ + 1; i < data_rank; ++i) {

attention_op_test.cc:304:85: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<float>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  304 |     } else if (batch_size * q_num_heads * q_sequence_length * total_sequence_length == attn_mask.size()) {
  
  /cast_op_test.cc:1487:24: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
 1487 |   for (size_t i = 0; i < num_pairs; ++i) {
      |                      ~~^~~~~~~~~~~     
```

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
naomiOvad pushed a commit to naomiOvad/onnxruntime that referenced this pull request Nov 2, 2025
Fix build warnings using cuda 12.8 in Linux like the following:
```
<command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]

gather_block_quantized.cc:95:40: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
   95 |   for (int64_t i = gather_axis_ + 1; i < data_rank; ++i) {

attention_op_test.cc:304:85: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<float>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  304 |     } else if (batch_size * q_num_heads * q_sequence_length * total_sequence_length == attn_mask.size()) {
  
  /cast_op_test.cc:1487:24: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
 1487 |   for (size_t i = 0; i < num_pairs; ++i) {
      |                      ~~^~~~~~~~~~~     
```

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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