namespace to reduce code
This commit is contained in:
parent
4302200a33
commit
6762230d9a
@ -6,12 +6,6 @@
|
||||
#include <thrust/execution_policy.h>
|
||||
#include "device_helpers.cuh"
|
||||
|
||||
#ifdef XGBOOST_USE_HIP
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
struct CUDAContext {
|
||||
private:
|
||||
|
||||
@ -54,4 +54,18 @@
|
||||
#define cudaDevAttrMultiProcessorCount hipDeviceAttributeMultiprocessorCount
|
||||
#define cudaOccupancyMaxActiveBlocksPerMultiprocessor hipOccupancyMaxActiveBlocksPerMultiprocessor
|
||||
|
||||
namespace thrust {
|
||||
namespace hip {
|
||||
}
|
||||
}
|
||||
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
|
||||
namespace hipcub {
|
||||
}
|
||||
|
||||
namespace cub = hipcub;
|
||||
|
||||
#endif
|
||||
|
||||
@ -26,12 +26,6 @@
|
||||
#include "quantile.h"
|
||||
#include "xgboost/host_device_vector.h"
|
||||
|
||||
#ifdef XGBOOST_USE_HIP
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::common {
|
||||
constexpr float SketchContainer::kFactor;
|
||||
|
||||
|
||||
@ -17,14 +17,6 @@
|
||||
#include "quantile.cuh"
|
||||
#include "xgboost/span.h" // for IterSpan
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace cub = hipcub;
|
||||
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::common {
|
||||
namespace cuda {
|
||||
/**
|
||||
|
||||
@ -8,12 +8,6 @@
|
||||
#include "xgboost/context.h" // Context
|
||||
#include "xgboost/host_device_vector.h" // HostDeviceVector
|
||||
|
||||
#ifdef XGBOOST_USE_HIP
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::common::cuda_impl {
|
||||
double Reduce(Context const* ctx, HostDeviceVector<float> const& values) {
|
||||
values.SetDevice(ctx->Device());
|
||||
|
||||
@ -22,12 +22,6 @@
|
||||
#include "transform_iterator.h" // MakeIndexTransformIter
|
||||
#include "xgboost/span.h"
|
||||
|
||||
#ifdef XGBOOST_USE_HIP
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace common {
|
||||
|
||||
|
||||
@ -10,12 +10,6 @@
|
||||
#include "timer.h"
|
||||
#include "categorical.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace common {
|
||||
|
||||
|
||||
@ -25,8 +25,6 @@
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
#include <hipcub/hipcub.hpp>
|
||||
|
||||
namespace cub = hipcub;
|
||||
#endif
|
||||
|
||||
namespace xgboost::ltr {
|
||||
|
||||
@ -15,10 +15,6 @@
|
||||
#include "xgboost/host_device_vector.h" // HostDeviceVector
|
||||
#include "xgboost/linalg.h" // linalg::TensorView, UnravelIndex, Apply
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace cub = hipcub;
|
||||
#endif
|
||||
|
||||
namespace xgboost::common::cuda_impl {
|
||||
void Median(Context const* ctx, linalg::TensorView<float const, 2> t,
|
||||
common::OptionalWeights weights, linalg::Tensor<float, 1>* out) {
|
||||
|
||||
@ -23,12 +23,6 @@
|
||||
#include "xgboost/context.h" // Context
|
||||
#include "xgboost/span.h" // Span
|
||||
|
||||
#ifdef XGBOOST_USE_HIP
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace common {
|
||||
namespace detail {
|
||||
|
||||
@ -15,13 +15,6 @@
|
||||
#include "xgboost/json.h"
|
||||
#include "xgboost/logging.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace cub = hipcub;
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace {
|
||||
auto SetDeviceToPtr(void const* ptr) {
|
||||
|
||||
@ -17,12 +17,6 @@
|
||||
#include "adapter.h"
|
||||
#include "array_interface.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace data {
|
||||
|
||||
|
||||
@ -16,12 +16,6 @@
|
||||
#include "simple_batch_iterator.h"
|
||||
#include "sparse_page_source.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::data {
|
||||
void IterativeDMatrix::InitFromCUDA(Context const* ctx, BatchParam const& p,
|
||||
DataIterHandle iter_handle, float missing,
|
||||
|
||||
@ -13,12 +13,6 @@
|
||||
#include "../common/error_msg.h" // for InfInData
|
||||
#include "device_adapter.cuh" // for HasInfInData
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::data {
|
||||
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
|
||||
@ -25,12 +25,6 @@
|
||||
#include "xgboost/data.h"
|
||||
#include "xgboost/span.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace metric {
|
||||
// tag the this file, used by force static link later.
|
||||
|
||||
@ -30,12 +30,6 @@
|
||||
#include "../common/device_helpers.cuh"
|
||||
#endif // defined(XGBOOST_USE_CUDA) || defined(XGBOOST_USE_HIP)
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace metric {
|
||||
// tag the this file, used by force static link later.
|
||||
|
||||
@ -24,12 +24,6 @@
|
||||
#include "../common/device_helpers.cuh"
|
||||
#endif // XGBOOST_USE_CUDA || XGBOOST_USE_HIP
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace metric {
|
||||
// tag the this file, used by force static link later.
|
||||
|
||||
@ -26,8 +26,6 @@
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
#include <hipcub/hipcub.hpp>
|
||||
|
||||
namespace cub = hipcub;
|
||||
#endif
|
||||
|
||||
namespace xgboost::metric {
|
||||
|
||||
@ -25,12 +25,6 @@
|
||||
#include "../common/device_helpers.cuh"
|
||||
#endif // XGBOOST_USE_CUDA || XGBOOST_USE_HIP
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
using AFTParam = xgboost::common::AFTParam;
|
||||
using ProbabilityDistributionType = xgboost::common::ProbabilityDistributionType;
|
||||
template <typename Distribution>
|
||||
|
||||
@ -19,11 +19,6 @@
|
||||
#include "xgboost/context.h"
|
||||
|
||||
namespace xgboost {
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace cub = hipcub;
|
||||
#endif
|
||||
|
||||
namespace obj {
|
||||
namespace detail {
|
||||
void EncodeTreeLeafDevice(Context const* ctx, common::Span<bst_node_t const> position,
|
||||
|
||||
@ -35,8 +35,6 @@
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
#include <hipcub/hipcub.hpp>
|
||||
|
||||
namespace cub = hipcub;
|
||||
#endif
|
||||
|
||||
namespace xgboost::obj {
|
||||
|
||||
@ -29,12 +29,6 @@
|
||||
#include "xgboost/tree_model.h"
|
||||
#include "xgboost/tree_updater.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::predictor {
|
||||
DMLC_REGISTRY_FILE_TAG(gpu_predictor);
|
||||
|
||||
|
||||
@ -21,12 +21,6 @@
|
||||
#include "xgboost/logging.h" // CHECK_EQ
|
||||
#include "xgboost/span.h" // span
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::tree::cuda_impl {
|
||||
void FitStump(Context const* ctx, MetaInfo const& info,
|
||||
linalg::TensorView<GradientPair const, 2> gpair, linalg::VectorView<float> out) {
|
||||
|
||||
@ -24,10 +24,6 @@
|
||||
#define WARP_SIZE WAVEFRONT_SIZE
|
||||
#endif
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace cub = hipcub;
|
||||
#endif
|
||||
|
||||
namespace xgboost::tree {
|
||||
// With constraints
|
||||
XGBOOST_DEVICE float LossChangeMissing(const GradientPairInt64 &scan,
|
||||
|
||||
@ -12,12 +12,6 @@
|
||||
#include "evaluate_splits.cuh"
|
||||
#include "xgboost/data.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost::tree {
|
||||
void GPUHistEvaluator::Reset(common::HistogramCuts const &cuts, common::Span<FeatureType const> ft,
|
||||
bst_feature_t n_features, TrainParam const ¶m,
|
||||
|
||||
@ -16,12 +16,6 @@
|
||||
#include "row_partitioner.cuh"
|
||||
#include "xgboost/base.h"
|
||||
|
||||
#if defined(XGBOOST_USE_HIP)
|
||||
namespace thrust {
|
||||
namespace cuda = thrust::hip;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace xgboost {
|
||||
namespace tree {
|
||||
namespace {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user