def METHOD_NAME(self, n_samples, n_features, sparsity) -> None:
    import cupy as cp
    X, y = tm.make_sparse_regression(n_samples, n_features, sparsity, False)
    h_X = X.astype(np.float32)
    csr = h_X
    h_X = X.toarray()
    h_X[h_X == 0] = np.nan
    h_m = xgb.QuantileDMatrix(data=h_X)
    h_ret = h_m.get_data()
    d_X = cp.array(h_X)
    d_m = xgb.QuantileDMatrix(data=d_X, label=y)
    d_ret = d_m.get_data()
    np.testing.assert_equal(csr.indptr, d_ret.indptr)
    np.testing.assert_equal(csr.indices, d_ret.indices)
    np.testing.assert_equal(h_ret.indptr, d_ret.indptr)
    np.testing.assert_equal(h_ret.indices, d_ret.indices)
    booster = xgb.train(
        {"tree_method": "hist", "device": "cuda:0"}, dtrain=d_m
    )
    np.testing.assert_allclose(
        booster.predict(d_m),
        booster.predict(xgb.DMatrix(d_m.get_data())),
        atol=1e-6,
    )