Skip to content

Add error checking for our C example code#1171

Merged
rapids-bot[bot] merged 5 commits intorapidsai:branch-25.08from
benfred:c_example_error_checking
Jul 24, 2025
Merged

Add error checking for our C example code#1171
rapids-bot[bot] merged 5 commits intorapidsai:branch-25.08from
benfred:c_example_error_checking

Conversation

@benfred
Copy link
Copy Markdown
Contributor

@benfred benfred commented Jul 24, 2025

We weren't consistently checking the return value of cuda and cuvs functions in our C examples.

This caused problems when we tried to adapt the SQ code to an example, and it was returning invalid results. The root cause was because a function was failing, but we didn't notice because the pattern has been to ignore the error codes.

Enforce best practices and check the result of every cuvs and cuda function call in our c examples.

Also:

  • enable -Wall and -Werror to the c examples for extra compile time checks
  • add examples to CODEOWNERS
  • ensure that clang-format runs on the example files

We weren't consistently checking the return value of cuda and cuvs
functions in our C examples.

This caused problems when we tried to adapt the SQ code to an example,
and it was returning invalid results. The root cause was because
a function was failing, but we didn't notice because the pattern
has been to ignore the error codes.

Enforce best practices and check the result of every cuvs and cuda
function call in our c examples.

Also enable -Wall and -Werror for extra compile time checks
@benfred benfred requested a review from a team as a code owner July 24, 2025 02:08
@benfred benfred added the non-breaking Introduces a non-breaking change label Jul 24, 2025
@github-actions github-actions Bot added CMake and removed non-breaking Introduces a non-breaking change labels Jul 24, 2025
@benfred benfred added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Jul 24, 2025
benfred added 2 commits July 23, 2025 19:09
the pre-commit config wasn't automaticaly applying clang-format to files
in the example directory. This seems to be because we were missing the
.clang-format file, which was only in the /cpp/ directory.

symlink these files over, and reformat with the settings there
@benfred benfred requested a review from a team as a code owner July 24, 2025 05:36
@benfred benfred requested a review from a team as a code owner July 24, 2025 05:43
@benfred benfred requested a review from gforsyth July 24, 2025 05:43
@benfred
Copy link
Copy Markdown
Contributor Author

benfred commented Jul 24, 2025

/merge

@rapids-bot rapids-bot Bot merged commit ed32f0f into rapidsai:branch-25.08 Jul 24, 2025
53 checks passed
@benfred benfred deleted the c_example_error_checking branch July 24, 2025 14:11
lowener pushed a commit to lowener/cuvs that referenced this pull request Aug 11, 2025
We weren't consistently checking the return value of cuda and cuvs functions in our C examples.

This caused problems when we tried to adapt the SQ code to an example, and it was returning invalid results. The root cause was because a function was failing, but we didn't notice because the pattern has been to ignore the error codes.

Enforce best practices and check the result of every cuvs and cuda function call in our c examples.

Also:
* enable -Wall and -Werror to the c examples for extra compile time checks
* add examples to CODEOWNERS
*  ensure that clang-format runs on the example files

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Gil Forsyth (https://github.com/gforsyth)

URL: rapidsai#1171
enp1s0 pushed a commit to enp1s0/cuvs that referenced this pull request Aug 22, 2025
We weren't consistently checking the return value of cuda and cuvs functions in our C examples.

This caused problems when we tried to adapt the SQ code to an example, and it was returning invalid results. The root cause was because a function was failing, but we didn't notice because the pattern has been to ignore the error codes.

Enforce best practices and check the result of every cuvs and cuda function call in our c examples.

Also:
* enable -Wall and -Werror to the c examples for extra compile time checks
* add examples to CODEOWNERS
*  ensure that clang-format runs on the example files

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Gil Forsyth (https://github.com/gforsyth)

URL: rapidsai#1171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants