[fed] Split up federated test CMake file. (#10566)
- Collect all federated test files into the same directory. - Independently list the files.
This commit is contained in:
20
tests/cpp/plugin/federated/CMakeLists.txt
Normal file
20
tests/cpp/plugin/federated/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
target_sources(
|
||||
testxgboost PRIVATE
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_coll.cc
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_comm.cc
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_comm_group.cc
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_tracker.cc
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_learner.cc
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_data.cc
|
||||
)
|
||||
|
||||
if(USE_CUDA)
|
||||
target_sources(
|
||||
testxgboost PRIVATE
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_coll.cu
|
||||
${xgboost_SOURCE_DIR}/tests/cpp/plugin/federated/test_federated_comm_group.cu
|
||||
)
|
||||
endif()
|
||||
|
||||
target_include_directories(testxgboost PRIVATE ${xgboost_SOURCE_DIR}/plugin/federated)
|
||||
target_link_libraries(testxgboost PRIVATE federated_client)
|
||||
@@ -1,15 +1,13 @@
|
||||
/*!
|
||||
* Copyright 2023 XGBoost contributors
|
||||
/**
|
||||
* Copyright 2023-2024, XGBoost contributors
|
||||
*/
|
||||
#include <gtest/gtest.h>
|
||||
#include <xgboost/data.h>
|
||||
|
||||
#include <thread>
|
||||
|
||||
#include "../../../src/collective/communicator-inl.h"
|
||||
#include "../filesystem.h"
|
||||
#include "../helpers.h"
|
||||
#include "federated/test_worker.h"
|
||||
#include "../../../../src/collective/communicator-inl.h"
|
||||
#include "../../filesystem.h"
|
||||
#include "../../helpers.h"
|
||||
#include "test_worker.h"
|
||||
|
||||
namespace xgboost {
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
/**
|
||||
* Copyright 2023-2024, XGBoost contributors
|
||||
*
|
||||
* Some other tests for federated learning are in the main test suite (test_learner.cc),
|
||||
* gaurded by the `XGBOOST_USE_FEDERATED`.
|
||||
* Some other tests for federated learning are in the main test suite (test_learner.cc).
|
||||
*/
|
||||
#include <dmlc/parameter.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <xgboost/data.h>
|
||||
#include <xgboost/objective.h>
|
||||
|
||||
#include "../../../src/collective/communicator-inl.h"
|
||||
#include "../../../src/common/linalg_op.h" // for begin, end
|
||||
#include "../helpers.h"
|
||||
#include "../objective_helpers.h" // for MakeObjNamesForTest, ObjTestNameGenerator
|
||||
#include "federated/test_worker.h"
|
||||
#include "../../../../src/collective/communicator-inl.h"
|
||||
#include "../../../../src/common/linalg_op.h" // for begin, end
|
||||
#include "../../helpers.h"
|
||||
#include "../../objective_helpers.h" // for MakeObjNamesForTest, ObjTestNameGenerator
|
||||
#include "test_worker.h"
|
||||
|
||||
namespace xgboost {
|
||||
namespace {
|
||||
Reference in New Issue
Block a user