Export c++ headers in CMake installation. (#4897)
* Move get transpose into cc. * Clean up headers in host device vector, remove thrust dependency. * Move span and host device vector into public. * Install c++ headers. * Short notes for c and c++. Co-Authored-By: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
@@ -11,8 +11,10 @@
|
||||
#include <rabit/rabit.h>
|
||||
#include <cub/util_allocator.cuh>
|
||||
|
||||
#include "xgboost/host_device_vector.h"
|
||||
#include "xgboost/span.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "span.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <omp.h>
|
||||
@@ -1132,6 +1134,27 @@ xgboost::common::Span<T> ToSpan(thrust::device_vector<T>& vec,
|
||||
return ToSpan(vec, static_cast<IndexT>(offset), static_cast<IndexT>(size));
|
||||
}
|
||||
|
||||
// thrust begin, similiar to std::begin
|
||||
template <typename T>
|
||||
thrust::device_ptr<T> tbegin(xgboost::HostDeviceVector<T>& vector) { // NOLINT
|
||||
return thrust::device_ptr<T>(vector.DevicePointer());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
thrust::device_ptr<T> tend(xgboost::HostDeviceVector<T>& vector) { // // NOLINT
|
||||
return tbegin(vector) + vector.Size();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
thrust::device_ptr<T const> tcbegin(xgboost::HostDeviceVector<T> const& vector) {
|
||||
return thrust::device_ptr<T const>(vector.ConstDevicePointer());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
thrust::device_ptr<T const> tcend(xgboost::HostDeviceVector<T> const& vector) {
|
||||
return tcbegin(vector) + vector.Size();
|
||||
}
|
||||
|
||||
template <typename FunctionT>
|
||||
class LauncherItr {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user