message: Enabling amdgpu backend in XLA unit tests
diff: """Build rules for XLA testing."""
  load("@local_config_cuda//cuda:build_defs.bzl", "cuda_is_configured")
  +load("@local_config_rocm//rocm:build_defs.bzl", "rocm_is_configured")
  load("//tensorflow/compiler/xla/tests:plugin.bzl", "plugins")
  load("//tensorflow:tensorflow.bzl", "tf_cc_test")
  load(
  "//tensorflow/core/platform:default/build_config_root.bzl",
  "tf_cuda_tests_tags",
  + "tf_gpu_tests_tags",
  )
  all_backends = ["cpu", "gpu"] + plugins.keys()
  def filter_backends(backends):
  - """Removes "gpu" from a backend list if CUDA is not enabled.
  + """Removes "gpu" from a backend list if Cuda or Rocm is not enabled.
  This allows us to simply hardcode lists including "gpu" here and in the
  - BUILD file, without causing failures when CUDA isn't enabled.'
  + BUILD file, without causing failures when Cuda or Rocm isn't enabled.'
  Args:
  backends: A list of backends to filter.
  @@ -24,6 +26,8 @@ def filter_backends(backends):
  """
  if cuda_is_configured():
  return backends
  + elif rocm_is_configured():
  + return backends
  else:
  return [backend for backend in backends if backend != "gpu"]
  