code: def test_roc_auc_ltr(self, n_samples):
      import numpy as np
  
      rng = np.random.RandomState(1994)
      n_samples = n_samples
      n_features = 10
      X = rng.randn(n_samples, n_features)
      y = rng.randint(0, 16, size=n_samples)
      group = np.array([n_samples // 2, n_samples // 2])
  
      Xy = xgboost.DMatrix(X, y, group=group)
  
      booster = xgboost.train(
          {
              "tree_method": "hist",
              "eval_metric": "auc",
              "objective": "rank:ndcg",
          },
          Xy,
          num_boost_round=10,
      )
      cpu_auc = float(booster.eval(Xy).split(":")[1])
      booster.set_param({"device": "cuda:0"})
      assert (
          json.loads(booster.save_config())["learner"]["generic_param"][
              "device"
          ]
          == "cuda:0"
      )
      gpu_auc = float(booster.eval(Xy).split(":")[1])
      assert (
          json.loads(booster.save_config())["learner"]["generic_param"][
              "device"
          ]
          == "cuda:0"
      )
  
      np.testing.assert_allclose(cpu_auc, gpu_auc)
  
file_path: xgboost/tests/python-gpu/test_gpu_eval_metrics.py
imports: import json
  import sys
  import pytest
  import xgboost
  from xgboost import testing
  from xgboost.testing.metrics import check_precision_score, check_quantile_error
  import test_eval_metrics
label_desc: Use image node_id 3 for calling the TestGPUEvalMetrics obj's underlying member method code with example usage: obj.test_roc_auc_ltr(n_samples) without return types