[XLA:GPU] Let TritonFusion depend on CUDA or ROCm headers (transitively).
[XLA:GPU] Let TritonFusion depend on CUDA or ROCm headers (transitively).

So far, we guard the dep with `#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM` and return an unimplemented error otherwise. However, having `"triton"` in the build graph makes no sense if neither CUDA nor ROCm toolkits are available at build time. This PR moves the `if_gpu_is_configured` branching upwards in the build graph to `"ir_emitter_unnested`".

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/12297 from lingzhi98:lingzhi/fix_transpose_index_computation bc1d3854e90f66b2874d54bbcdd48a45d8dccf1c
