Fix: memory cross-border access on the ROCM platform (#76100)
Fixes #76095, memory cross-border access on the ROCM platform.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76100
Approved by: https://github.com/jeffdaily, https://github.com/kit1980