[R package] GPU support (#2732)
* [R] MSVC compatibility * [GPU] allow seed in BernoulliRng up to size_t and scale to uint32_t * R package build with cmake and CUDA * R package CUDA build fixes and cleanups * always export the R package native initialization routine on windows * update the install instructions doc * fix lint * use static_cast directly to set BernoulliRng seed * [R] demo for GPU accelerated algorithm * tidy up the R package cmake stuff * R pack cmake: installs main dependency packages if needed * [R] version bump in DESCRIPTION * update NEWS * added short missing/sparse values explanations to FAQ
This commit is contained in:
committed by
GitHub
parent
5c9f01d0a9
commit
74db9757b3
@@ -199,9 +199,11 @@ inline void dense2sparse_tree(RegTree* p_tree,
|
||||
|
||||
struct BernoulliRng {
|
||||
float p;
|
||||
int seed;
|
||||
uint32_t seed;
|
||||
|
||||
__host__ __device__ BernoulliRng(float p, int seed) : p(p), seed(seed) {}
|
||||
__host__ __device__ BernoulliRng(float p, size_t seed_) : p(p) {
|
||||
seed = static_cast<uint32_t>(seed_);
|
||||
}
|
||||
|
||||
__host__ __device__ bool operator()(const int i) const {
|
||||
thrust::default_random_engine rng(seed);
|
||||
|
||||
Reference in New Issue
Block a user