Skip to content

[rocPRIM] Avoid creating void reference type in device batch memcpy#135

Merged
umfranzw merged 1 commit into
ROCm:release-staging/rocm-rel-7.0from
umfranzw:fix_batch_memcpy_ref_issue
Jun 4, 2025
Merged

[rocPRIM] Avoid creating void reference type in device batch memcpy#135
umfranzw merged 1 commit into
ROCm:release-staging/rocm-rel-7.0from
umfranzw:fix_batch_memcpy_ref_issue

Conversation

@umfranzw
Copy link
Copy Markdown
Contributor

@umfranzw umfranzw commented Jun 3, 2025

In the batch_memcpy_impl struct, we define two types based on the value of the InputBufferItType template argument.

  1. input_type, set to the InputBufferItType's underlying value_type's value_type.
  2. Alias, a type that's set using a std::conditional statement that examines the IsMemCpy boolean template arg, and may be set to either unsigned char or the type from (1).

Later code creates a reference to (1). This causes problems when (1) is void.

This change removes the definition of (1), since it does not appear to be used anywhere else in our repos (it's part of the detail namespace, so it's not public).

However, this is not enough to fix the problem, since the compiler evaluates both sides of the std::conditional we use to define (2). To work around this, this change also adds a helper struct type, (AliasType) that uses template specialization on the IsMemCpy boolean to define the type that Alias will be assigned. This allows us to remove the std::conditional statement.

In the batch_memcpy_impl struct, we define two types based on
the value of the InputBufferItType template argument.
1. input_type, set to the InputBufferItType's underlying value_type's value_type.
2. Alias, a type that's set using a std::conditional statement that examines the IsMemCpy
boolean template arg, and may be set to either unsigned char or the type from (1).

Later code creates a reference to (1). This causes problems when (1) is void.

This change removes the definition of (1), since it does not appear to be used anywhere else in
our repos (it's part of the detail namespace, so it's not public).

However, this is not enough to fix the problem, since the compiler evaluates both sides of the
std::conditional we use to define (2). To work around this, this change also adds a helper struct type,
(AliasType) that uses template specialization on the IsMemCpy boolean to define the type that Alias will
be assigned. This allows us to remove the std::conditional statement.
@umfranzw umfranzw changed the title Avoid creating void reference type in device batch memcpy [rocPRIM] Avoid creating void reference type in device batch memcpy Jun 3, 2025
@umfranzw umfranzw merged commit 85a254f into ROCm:release-staging/rocm-rel-7.0 Jun 4, 2025
21 of 26 checks passed
assistant-librarian Bot pushed a commit to ROCm/rocPRIM that referenced this pull request Jun 10, 2025
[rocPRIM] Avoid creating void reference type in device batch
 memcpy (#135)

In the batch_memcpy_impl struct, we define two types based on the value
of the InputBufferItType template argument.
1. input_type, set to the InputBufferItType's underlying value_type's
value_type.
2. Alias, a type that's set using a std::conditional statement that
examines the IsMemCpy boolean template arg, and may be set to either
unsigned char or the type from (1).

Later code creates a reference to (1). This causes problems when (1) is
void.

This change removes the definition of (1), since it does not appear to
be used anywhere else in our repos (it's part of the detail namespace,
so it's not public).

However, this is not enough to fix the problem, since the compiler
evaluates both sides of the std::conditional we use to define (2). To
work around this, this change also adds a helper struct type,
(AliasType) that uses template specialization on the IsMemCpy boolean to
define the type that Alias will be assigned. This allows us to remove
the std::conditional statement.
jayhawk-commits pushed a commit that referenced this pull request Jun 17, 2025
…135)

In the batch_memcpy_impl struct, we define two types based on the value
of the InputBufferItType template argument.
1. input_type, set to the InputBufferItType's underlying value_type's
value_type.
2. Alias, a type that's set using a std::conditional statement that
examines the IsMemCpy boolean template arg, and may be set to either
unsigned char or the type from (1).

Later code creates a reference to (1). This causes problems when (1) is
void.

This change removes the definition of (1), since it does not appear to
be used anywhere else in our repos (it's part of the detail namespace,
so it's not public).

However, this is not enough to fix the problem, since the compiler
evaluates both sides of the std::conditional we use to define (2). To
work around this, this change also adds a helper struct type,
(AliasType) that uses template specialization on the IsMemCpy boolean to
define the type that Alias will be assigned. This allows us to remove
the std::conditional statement.
jayhawk-commits added a commit that referenced this pull request Jun 18, 2025
### Includes the following PRs:
- #76 
- #77 
- #78 
- #90 
- #135 
- #150 
- #192

---------

Co-authored-by: Nick Breed <78807921+NB4444@users.noreply.github.com>
Co-authored-by: Sander Bos <sander@streamhpc.com>
Co-authored-by: Nara Prasetya <nara@streamhpc.com>
Co-authored-by: Michael Kuron <1748330+mkuron@users.noreply.github.com>
Co-authored-by: Wayne Franz <wayfranz@amd.com>
ammallya pushed a commit that referenced this pull request Sep 24, 2025
* Defaulting clang-tidy checks to off during rename process

* New rules

* Descriptors renamed (#135)

* New rules

* Descriptors renamed

* Formatting fixes

* rename backend/src/plugin folder (#136)

* rename backend/src/plugin folder

* fix comments

* missed 2 changes

* Missed renaming shared library as part of plugins (#139)

* Handle Renamed (#134)

* rename handles

* ignore hipdnnHandle in clang tidy

* review comments

* rename miopen legacy plugin engines. (#141)

* Backend Rename Leftovers (#138)

* Performed the rest of the backend renames

* Format

* PR comments

* Renaming in hipdnn_frontend/attributes (#140)

Update naming for our new tidy rules

* renames for miopen_legacy_plugin/root (#142)

* Renaming miopen legacy plugin base dir

* fix missed variable and function

* Rename sdk plugin (#145)

* Rename Engine_config_interface

* fix tests

* Convert wrappers and test utils

* Remaining plugin sdk renames

* formatting

* Apply formatting

* Fix snake_case for last_erorr

* Renaming in miopen legacy tests (#143)

* first batch of legacy tests

* tests set 2 for miopen legacy plugin

* missed integration tests, fix small issues

* fix

* another fix

* rename

* Rename sdk plugin tests (#148)

* Rename sdk/include/hipdnn_sdk/test_utilties symbols and usages (#146)

* Rename sdk/include/hipdnn_sdk/test_utilties symbols and usages

* Format

* Fix test_tensor names

* merge conflicts fix

* format changes

* format

---------

Co-authored-by: Brian Harrison <brian.harrison@amd.com>

* Update sdk logging names (#147)

Co-authored-by: Brian Harrison <brian.harrison@amd.com>

* Rename sdk test_utilities tests (#150)

* Renaming complete in sdk utilities, tests, and samples. (#149)

* Apply formatting

* Rename frontend's backend wrappers and helpers (#152)

* Renamed frontend's backend wrappers and helpers

* Format

* Rename backend integration tests (#153)

* Rename backend integration tests

* formatting

* Fix missing rename variable

* Renaming frontend/node and base dir (#157)

* miopen plugin interface renames (#158)

* /backend/tests/ rename (#156)

* /backend/tests/ rename

* Uncomment

* Change global

* Rename test plugins (#160)

* Rename test plugins for the new naming scheme

* Formatting

* Fix accidental rename

* Camel case for InitialziePlugin

* Samples renamed (#159)

* Renamed samples

* Format

* Typo and wrong casing

---------

Co-authored-by: Samuel Reeder <samuel.reeder@amd.com>

* Frontend integration tests renamed (#161)

* Rename sdk tests utilities (#162)

* Rename sdk test utilities to match new scheme

* Swap to s_ instead of g_ for local static

* camelCase

* Replace global with test fixture (#163)

* Replace global with test fixture

* Change name

* Rename test internals (#164)

* Fix SDK tidy breaks

* Backend fixes

* More backend and updated clang-tidy for constexpr

* Fix tidy errors

* More tidy fixes for plugin, sdk, and backend

* NOLINT setters and more of frontend

* Fix backend tidy error

* More frontend fixes

* Lint free (by my reckoning)

* I did this by hand

* Add code style and naming doc (#165)

* style doc v1

* add table of contents

* fix first batch of comments

* review concerns, and new section 14

* add links to style doc from other places

* update both cline and copilot instructions to match (#166)

* Tidy fixes (#167)

* fix a few tidy issues

* change tidy to *

* Re-enable enum tidies

* default tidy back on

---------

Co-authored-by: Jeremy Hart <jeremy.hart@amd.com>

* fix formatting (#168)

---------

Co-authored-by: mousdahl-amd <mitch.ousdahl@amd.com>
Co-authored-by: Adam Dickin <adam.dickin@amd.com>
Co-authored-by: bibek <108366729+bghimireamd@users.noreply.github.com>
Co-authored-by: Jeremy Hart <jeremy.hart@amd.com>
Co-authored-by: BrianHarrisonAMD <169072757+BrianHarrisonAMD@users.noreply.github.com>
Co-authored-by: Brian Harrison <brian.harrison@amd.com>
ammallya pushed a commit that referenced this pull request Sep 24, 2025
* Defaulting clang-tidy checks to off during rename process

* New rules

* Descriptors renamed (#135)

* New rules

* Descriptors renamed

* Formatting fixes

* rename backend/src/plugin folder (#136)

* rename backend/src/plugin folder

* fix comments

* missed 2 changes

* Missed renaming shared library as part of plugins (#139)

* Handle Renamed (#134)

* rename handles

* ignore hipdnnHandle in clang tidy

* review comments

* rename miopen legacy plugin engines. (#141)

* Backend Rename Leftovers (#138)

* Performed the rest of the backend renames

* Format

* PR comments

* Renaming in hipdnn_frontend/attributes (#140)

Update naming for our new tidy rules

* renames for miopen_legacy_plugin/root (#142)

* Renaming miopen legacy plugin base dir

* fix missed variable and function

* Rename sdk plugin (#145)

* Rename Engine_config_interface

* fix tests

* Convert wrappers and test utils

* Remaining plugin sdk renames

* formatting

* Apply formatting

* Fix snake_case for last_erorr

* Renaming in miopen legacy tests (#143)

* first batch of legacy tests

* tests set 2 for miopen legacy plugin

* missed integration tests, fix small issues

* fix

* another fix

* rename

* Rename sdk plugin tests (#148)

* Rename sdk/include/hipdnn_sdk/test_utilties symbols and usages (#146)

* Rename sdk/include/hipdnn_sdk/test_utilties symbols and usages

* Format

* Fix test_tensor names

* merge conflicts fix

* format changes

* format

---------

Co-authored-by: Brian Harrison <brian.harrison@amd.com>

* Update sdk logging names (#147)

Co-authored-by: Brian Harrison <brian.harrison@amd.com>

* Rename sdk test_utilities tests (#150)

* Renaming complete in sdk utilities, tests, and samples. (#149)

* Apply formatting

* Rename frontend's backend wrappers and helpers (#152)

* Renamed frontend's backend wrappers and helpers

* Format

* Rename backend integration tests (#153)

* Rename backend integration tests

* formatting

* Fix missing rename variable

* Renaming frontend/node and base dir (#157)

* miopen plugin interface renames (#158)

* /backend/tests/ rename (#156)

* /backend/tests/ rename

* Uncomment

* Change global

* Rename test plugins (#160)

* Rename test plugins for the new naming scheme

* Formatting

* Fix accidental rename

* Camel case for InitialziePlugin

* Samples renamed (#159)

* Renamed samples

* Format

* Typo and wrong casing

---------

Co-authored-by: Samuel Reeder <samuel.reeder@amd.com>

* Frontend integration tests renamed (#161)

* Rename sdk tests utilities (#162)

* Rename sdk test utilities to match new scheme

* Swap to s_ instead of g_ for local static

* camelCase

* Replace global with test fixture (#163)

* Replace global with test fixture

* Change name

* Rename test internals (#164)

* Fix SDK tidy breaks

* Backend fixes

* More backend and updated clang-tidy for constexpr

* Fix tidy errors

* More tidy fixes for plugin, sdk, and backend

* NOLINT setters and more of frontend

* Fix backend tidy error

* More frontend fixes

* Lint free (by my reckoning)

* I did this by hand

* Add code style and naming doc (#165)

* style doc v1

* add table of contents

* fix first batch of comments

* review concerns, and new section 14

* add links to style doc from other places

* update both cline and copilot instructions to match (#166)

* Tidy fixes (#167)

* fix a few tidy issues

* change tidy to *

* Re-enable enum tidies

* default tidy back on

---------

Co-authored-by: Jeremy Hart <jeremy.hart@amd.com>

* fix formatting (#168)

---------

Co-authored-by: mousdahl-amd <mitch.ousdahl@amd.com>
Co-authored-by: Adam Dickin <adam.dickin@amd.com>
Co-authored-by: bibek <108366729+bghimireamd@users.noreply.github.com>
Co-authored-by: Jeremy Hart <jeremy.hart@amd.com>
Co-authored-by: BrianHarrisonAMD <169072757+BrianHarrisonAMD@users.noreply.github.com>
Co-authored-by: Brian Harrison <brian.harrison@amd.com>

[ROCm/hipDNN commit: 839cf6c]
evetsso pushed a commit to evetsso/rocm-libraries that referenced this pull request Dec 31, 2025
…-from-develop-082125/AMD-ROCm-Internal_hipSPARSELt/current-gfx1250-copy-081925

Merge current-gfx1250-copy-081925 into new-gfx1250-from-develop-081925
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.

3 participants