Test cpp_wrapper_hipify string comparison (#141353)

Updating the test to match this code that takes device warpsize into account: cf1d95a965/torch/_inductor/codegen/cuda/device_op_overrides.py (L120)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/141353
Approved by: https://github.com/desertfire
This commit is contained in:
iupaikov-amd
2024-12-03 18:25:29 +00:00
committed by PyTorch MergeBot
parent 8b5c26287d
commit 7bb2228ffd

View File

@ -110,7 +110,11 @@ class TestCppWrapperHipify(TestCase):
}
"""
if torch.version.hip is not None:
expected = expected.replace("32*numWarps", "64*numWarps")
# Adjusting the warp size to GPU supported wavefront size on AMD GPU
prop = torch.cuda.get_device_properties(torch.cuda.current_device())
expected = expected.replace(
"32*numWarps", str(prop.warp_size) + "*numWarps"
)
result = maybe_hipify_code_wrapper(header, True)
self.assertEqual(result.rstrip(), expected.rstrip())