PR #11307: [ROCm] Upstreaming old changes
PR #11307: [ROCm] Upstreaming old changes

Imported from GitHub PR https://github.com/openxla/xla/pull/11307

This PR upstreams changes from [#2467](https://github.com/ROCm/tensorflow-upstream/pull/2467/commits/c3d966e559ffd13f6a473d1b57e606314a456ce8) and also upstreams changes to `gpu_layout_assignment.cc` introduced [here](https://github.com/ROCm/tensorflow-upstream/commit/b34b1eb35c095a16208356913a956256cc419e99) and [here](https://github.com/ROCm/tensorflow-upstream/commit/dfb7dd0b2f7e6c6bbcd3f1dbc9e299be9554b4a7).
Copybara import of the project:

--
ceaa8b0ab3dfda7ad93a7c57f5c26e6b31365a80 by mmakevic <Milica.Makevic@amd.com>:

adding env variable to control rocm_dnn workspace limit

--
b7661ef811dfff68e03b4fe4306c1f63ffd1e2ee by mmakevic <Milica.Makevic@amd.com>:

Changes to use NHWC for FP16 ops on XLA path for ROCm 5.0 and MI100/200

Fix double =

--
cfeb2dec629eac32d5afc8256f2c684bbe81fe75 by mmakevic <Milica.Makevic@amd.com>:

Check if rocm or cuda are used during runtime

Merging this change closes #11307

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/11307 from ROCm:ci_upstream_old_changes cfeb2dec629eac32d5afc8256f2c684bbe81fe75
