Skip to content

Comments

Add workaround for printing 128-bit types in gtest for windows#708

Merged
stanleytsang-amd merged 5 commits intoROCm:developfrom
stanleytsang-amd:128bit-gtest-output-windows
Apr 11, 2025
Merged

Add workaround for printing 128-bit types in gtest for windows#708
stanleytsang-amd merged 5 commits intoROCm:developfrom
stanleytsang-amd:128bit-gtest-output-windows

Conversation

@stanleytsang-amd
Copy link
Collaborator

@stanleytsang-amd stanleytsang-amd commented Mar 27, 2025

@stanleytsang-amd stanleytsang-amd marked this pull request as ready for review March 28, 2025 22:16
@stanleytsang-amd stanleytsang-amd marked this pull request as draft March 29, 2025 01:58
@Snektron
Copy link
Contributor

I'm kind of confused why this workaround is suddenly required now. We were previously able to fully enable 128-bit integers in Windows and we observe no failures in our Windows CI, see b57e163. If you are seeing failures on your side, then perhaps we are both using different versions of the Windows SDK or MSVC compiler? It would be nice to know what those are so that we can use the same configuration on our CI.

@stanleytsang-amd
Copy link
Collaborator Author

stanleytsang-amd commented Mar 31, 2025

I'm kind of confused why this workaround is suddenly required now. We were previously able to fully enable 128-bit integers in Windows and we observe no failures in our Windows CI, see b57e163. If you are seeing failures on your side, then perhaps we are both using different versions of the Windows SDK or MSVC compiler? It would be nice to know what those are so that we can use the same configuration on our CI.

I'm not entirely sure either, we did not see the problem initially with our CI but it has now come up in our CI and also in staging, and also a compiler dev reported it as well. With the compiler dev's machine, I was able to resolve it by #706 , but that does not seem to work elsewhere. The reason I made this PR is because my local Windows machine does not exhibit this issue and I have limited ability to modify/update it at the moment, so I've been clumsily working via this PR.

Clearly it must be due to a difference in the HIP SDK build or the compiler version, as you stated. I will try to get that info. Unfortunately due to my limited understanding of the test assertion framework for rocPRIM, I've been unable to fix the problem - I'm clearly missing certain test cases/logic in the assertion code. @Snektron @Naraenda until I can nail down the exact HIP SDK build/compiler version, can you do a quick review and see what I'm missing? test_block_radix_sort fails to compile at the minimum. For a certainty it is related to 128-bit integers as my latest commit to disable them entirely in the unit testing causes the build to succeed (although it seemed to have hung at device_select...)

@Naraenda
Copy link
Member

Can you send us the build error (or entire log)? Either here or via e-mail. We can try narrowing it down on our side.

@stanleytsang-amd stanleytsang-amd marked this pull request as ready for review April 8, 2025 21:38
if (test_utils::is_int128<T>::value || test_utils::is_uint128<T>::value || (typeid(T) == typeid(common::custom_type<double,double,1>)))
{
const bool values_equal = (result[i] == expected[i]);
ASSERT_EQ(values_equal, true) << "where index = " << i;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a biggie but could also use
ASSERT_TRUE(values_equal)

Copy link
Collaborator

@NguyenNhuDi NguyenNhuDi left a comment

Choose a reason for hiding this comment

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

lgtm

@stanleytsang-amd stanleytsang-amd merged commit fa4811e into ROCm:develop Apr 11, 2025
24 of 25 checks passed
ammallya pushed a commit that referenced this pull request Oct 28, 2025
* Add workaround for printing 128-bit types in gtest for windows

* Update fix

* Disable all 128 bit tests

* Add workaround to more assert_eq overloads

* Fix tabs

[ROCm/rocPRIM commit: fa4811e]
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.

4 participants