Skip to content

[Clang-tidy] fix warning in copy_to_sycl_buffer function#1422

Merged
tdavidcl merged 5 commits into
Shamrock-code:mainfrom
Akos299:features/clang-tidy-fix-1
Dec 12, 2025
Merged

[Clang-tidy] fix warning in copy_to_sycl_buffer function#1422
tdavidcl merged 5 commits into
Shamrock-code:mainfrom
Akos299:features/clang-tidy-fix-1

Conversation

@Akos299

@Akos299 Akos299 commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

warning: 'equals' is deprecated: Use equals(const sham::DeviceScheduler_ptr &, sham::DeviceBuffer &, sham::DeviceBuffer &, u32 ) instead. [clang-diagnostic-deprecated-declarations]
280 | return equals(q, buf1, buf2, buf1.size());
| ^
/__w/Shamrock/Shamrock/src/tests/shambackends/DeviceBufferTests.cpp:120:35: note: in instantiation of function template specialization 'shamalgs::primitives::equals' requested here
120 | REQUIRE(shamalgs::primitives::equals(q, b1, b2));
| ^
/__w/Shamrock/Shamrock/src/shamalgs/include/shamalgs/primitives/equals.hpp:74:7: note: 'equals' has been explicitly marked deprecated here
74 | [[deprecated(
| ^

@Akos299 Akos299 requested a review from tdavidcl December 12, 2025 08:14
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Akos299, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to clean up the codebase by addressing a clang-tidy warning related to the use of a deprecated function within a test file. The change ensures that the test for copy_to_sycl_buffer continues to validate buffer equality correctly, without relying on an outdated API, thereby improving code maintainability and adherence to modern programming practices.

Highlights

  • Deprecated Function Usage: The pull request resolves a clang-diagnostic-deprecated-declarations warning by replacing a call to the deprecated shamalgs::primitives::equals function in DeviceBufferTests.cpp.
  • Test Logic Refactor: The deprecated function call has been replaced with an explicit element-by-element comparison of sycl::buffer contents using sycl::host_accessor, ensuring the test's functionality remains intact.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request resolves a clang-tidy warning about a deprecated function by replacing it with a manual, host-side comparison. However, the change introduces a logic error in the test by using an if statement instead of assertions for size checks. This could cause tests to pass silently when they should fail. My review includes a comment to correct this logic.

Comment thread src/tests/shambackends/DeviceBufferTests.cpp
Comment thread src/tests/shambackends/DeviceBufferTests.cpp
@tdavidcl

Copy link
Copy Markdown
Member

/gemini review

@github-actions

Copy link
Copy Markdown
Contributor

Workflow report

workflow report corresponding to commit 53b7aea
Commiter email is timothee.davidcleris@proton.me
GitHub page artifact URL GitHub page artifact link (can expire)

Pre-commit check report

Pre-commit check: ✅

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for merge conflicts................................................Passed
check that executables have shebangs.....................................Passed
check that scripts with shebangs are executable..........................Passed
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check for broken symlinks................................................Passed
check yaml...............................................................Passed
detect private key.......................................................Passed
No-tabs checker..........................................................Passed
Tabs remover.............................................................Passed
Validate GitHub Workflows................................................Passed
clang-format.............................................................Passed
black....................................................................Passed
ruff check...............................................................Passed
Check doxygen headers....................................................Passed
Check license headers....................................................Passed
Check #pragma once.......................................................Passed
Check SYCL #include......................................................Passed
No ssh in git submodules remote..........................................Passed

Test pipeline can run.

Clang-tidy diff report

No relevant changes found.
Well done!

You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review.

Doxygen diff with main

Removed warnings : 0
New warnings : 0
Warnings count : 7417 → 7417 (0.0%)

Detailed changes :

@tdavidcl tdavidcl merged commit 0acbc86 into Shamrock-code:main Dec 12, 2025
55 checks passed
DavidFang03 pushed a commit to DavidFang03/Shamrock that referenced this pull request Dec 12, 2025
…de#1422)

warning: 'equals<int>' is deprecated: Use equals(const
sham::DeviceScheduler_ptr &, sham::DeviceBuffer<T> &,
sham::DeviceBuffer<T> &, u32 ) instead.
[clang-diagnostic-deprecated-declarations]
  280 |         return equals(q, buf1, buf2, buf1.size());
      |                ^

/__w/Shamrock/Shamrock/src/tests/shambackends/DeviceBufferTests.cpp:120:35:
note: in instantiation of function template specialization
'shamalgs::primitives::equals<int>' requested here
  120 |     REQUIRE(shamalgs::primitives::equals(q, b1, b2));
      |                                   ^

/__w/Shamrock/Shamrock/src/shamalgs/include/shamalgs/primitives/equals.hpp:74:7:
note: 'equals<int>' has been explicitly marked deprecated here
   74 |     [[deprecated(
      |       ^

---------

Co-authored-by: David--Cléris Timothée <timothee.davidcleris@proton.me>
@Akos299 Akos299 deleted the features/clang-tidy-fix-1 branch February 16, 2026 14:42
aserhani pushed a commit to aserhani/Shamrock that referenced this pull request Feb 23, 2026
…de#1422)

warning: 'equals<int>' is deprecated: Use equals(const
sham::DeviceScheduler_ptr &, sham::DeviceBuffer<T> &,
sham::DeviceBuffer<T> &, u32 ) instead.
[clang-diagnostic-deprecated-declarations]
  280 |         return equals(q, buf1, buf2, buf1.size());
      |                ^

/__w/Shamrock/Shamrock/src/tests/shambackends/DeviceBufferTests.cpp:120:35:
note: in instantiation of function template specialization
'shamalgs::primitives::equals<int>' requested here
  120 |     REQUIRE(shamalgs::primitives::equals(q, b1, b2));
      |                                   ^

/__w/Shamrock/Shamrock/src/shamalgs/include/shamalgs/primitives/equals.hpp:74:7:
note: 'equals<int>' has been explicitly marked deprecated here
   74 |     [[deprecated(
      |       ^

---------

Co-authored-by: David--Cléris Timothée <timothee.davidcleris@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants