restore device helper

This commit is contained in:
amdsc21 2023-06-02 02:55:13 +02:00
parent 6ecd7903f2
commit 9ee1852d4e
13 changed files with 51 additions and 8 deletions

View File

@ -2,9 +2,6 @@
* Copyright 2017-2023 XGBoost contributors * Copyright 2017-2023 XGBoost contributors
*/ */
#pragma once #pragma once
#if defined(XGBOOST_USE_CUDA)
#include <thrust/binary_search.h> // thrust::upper_bound #include <thrust/binary_search.h> // thrust::upper_bound
#include <thrust/device_malloc_allocator.h> #include <thrust/device_malloc_allocator.h>
#include <thrust/device_ptr.h> #include <thrust/device_ptr.h>
@ -1385,7 +1382,3 @@ class LDGIterator {
} }
}; };
} // namespace dh } // namespace dh
#elif defined(XGBOOST_USE_HIP)
#include "device_helpers.hip.h"
#endif

View File

@ -6,7 +6,11 @@
#include <thrust/device_vector.h> #include <thrust/device_vector.h>
#include <vector> #include <vector>
#include "../../../src/common/bitfield.h" #include "../../../src/common/bitfield.h"
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/common/device_helpers.hip.h"
#endif
namespace xgboost { namespace xgboost {

View File

@ -6,7 +6,11 @@
#include <thrust/device_vector.h> #include <thrust/device_vector.h>
#include <vector> #include <vector>
#include <xgboost/base.h> #include <xgboost/base.h>
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/common/device_helpers.hip.h"
#endif
#include "../../../src/common/quantile.h" #include "../../../src/common/quantile.h"
#include "../helpers.h" #include "../helpers.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"

View File

@ -1,5 +1,9 @@
#include "../../../src/common/compressed_iterator.h" #include "../../../src/common/compressed_iterator.h"
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/common/device_helpers.hip.h"
#endif
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include <algorithm> #include <algorithm>
#include <thrust/device_vector.h> #include <thrust/device_vector.h>

View File

@ -6,7 +6,11 @@
#include <thrust/equal.h> #include <thrust/equal.h>
#include <thrust/iterator/counting_iterator.h> #include <thrust/iterator/counting_iterator.h>
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/common/device_helpers.hip.h"
#endif
#include <xgboost/host_device_vector.h> #include <xgboost/host_device_vector.h>
namespace xgboost { namespace xgboost {

View File

@ -7,7 +7,11 @@
#include <thrust/device_vector.h> #include <thrust/device_vector.h>
#include <thrust/execution_policy.h> #include <thrust/execution_policy.h>
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/common/device_helpers.hip.h"
#endif
#include <xgboost/span.h> #include <xgboost/span.h>
#include "test_span.h" #include "test_span.h"

View File

@ -6,7 +6,11 @@
#include <memory> #include <memory>
#include "../../../src/common/bitfield.h" #include "../../../src/common/bitfield.h"
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/common/device_helpers.hip.h"
#endif
namespace xgboost { namespace xgboost {

View File

@ -7,7 +7,11 @@
#include "../../../src/common/categorical.h" #include "../../../src/common/categorical.h"
#include "../../../src/common/hist_util.h" #include "../../../src/common/hist_util.h"
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/data/ellpack_page.cuh" #include "../../../src/data/ellpack_page.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/data/ellpack_page.hip.h"
#endif
#include "../../../src/tree/param.h" // TrainParam #include "../../../src/tree/param.h" // TrainParam
#include "../helpers.h" #include "../helpers.h"
#include "../histogram_helpers.h" #include "../histogram_helpers.h"

View File

@ -4,7 +4,11 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <xgboost/data.h> #include <xgboost/data.h>
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/data/ellpack_page.cuh" #include "../../../src/data/ellpack_page.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/data/ellpack_page.hip.h"
#endif
#include "../../../src/data/sparse_page_source.h" #include "../../../src/data/sparse_page_source.h"
#include "../../../src/tree/param.h" // TrainParam #include "../../../src/tree/param.h" // TrainParam
#include "../filesystem.h" // dmlc::TemporaryDirectory #include "../filesystem.h" // dmlc::TemporaryDirectory

View File

@ -6,7 +6,11 @@
#include <xgboost/data.h> #include <xgboost/data.h>
#include <xgboost/json.h> #include <xgboost/json.h>
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/common/device_helpers.hip.h"
#endif
#include "test_array_interface.h" #include "test_array_interface.h"
#include "test_metainfo.h" #include "test_metainfo.h"

View File

@ -4,7 +4,11 @@
#include <xgboost/data.h> // for DMatrix #include <xgboost/data.h> // for DMatrix
#include "../../../src/common/compressed_iterator.h" #include "../../../src/common/compressed_iterator.h"
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/data/ellpack_page.cuh" #include "../../../src/data/ellpack_page.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/data/ellpack_page.hip.h"
#endif
#include "../../../src/data/sparse_page_dmatrix.h" #include "../../../src/data/sparse_page_dmatrix.h"
#include "../../../src/tree/param.h" // TrainParam #include "../../../src/tree/param.h" // TrainParam
#include "../filesystem.h" // dmlc::TemporaryDirectory #include "../filesystem.h" // dmlc::TemporaryDirectory

View File

@ -3,9 +3,13 @@
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#if defined(XGBOOST_USE_CUDA)
#include "../../../../src/data/ellpack_page.cuh" #include "../../../../src/data/ellpack_page.cuh"
#include "../../../../src/tree/gpu_hist/gradient_based_sampler.cuh" #include "../../../../src/tree/gpu_hist/gradient_based_sampler.cuh"
#include "../../../../src/tree/param.h" #elif defined(XGBOOST_USE_HIP)
#include "../../../../src/data/ellpack_page.hip.h"
#include "../../../../src/tree/gpu_hist/gradient_based_sampler.hip.h"
#endif
#include "../../../../src/tree/param.h" // TrainParam #include "../../../../src/tree/param.h" // TrainParam
#include "../../filesystem.h" // dmlc::TemporaryDirectory #include "../../filesystem.h" // dmlc::TemporaryDirectory
#include "../../helpers.h" #include "../../helpers.h"

View File

@ -8,9 +8,15 @@
#include <string> #include <string>
#include <bitset> #include <bitset>
#include <set> #include <set>
#if defined(XGBOOST_USE_CUDA)
#include "../../../src/tree/constraints.cuh" #include "../../../src/tree/constraints.cuh"
#include "../../../src/tree/param.h" #include "../../../src/tree/param.h"
#include "../../../src/common/device_helpers.cuh" #include "../../../src/common/device_helpers.cuh"
#elif defined(XGBOOST_USE_HIP)
#include "../../../src/tree/constraints.hip.h"
#include "../../../src/tree/param.h"
#include "../../../src/common/device_helpers.hip.h"
#endif
namespace xgboost { namespace xgboost {
namespace { namespace {