xgboost
|
Do Transformation on HostDeviceVectors. More...
#include <transform.h>
Static Public Member Functions | |
template<typename Functor > | |
static Evaluator< Functor > | Init (Functor func, Range const range, GPUSet const devices, bool const shard=true) |
Initialize a Transform object. More... | |
template<typename Functor > | |
static Evaluator< Functor > | Init (Functor func, Range const range, GPUDistribution const dist, bool const shard=true) |
Do Transformation on HostDeviceVectors.
CompiledWithCuda | A bool parameter used to distinguish compilation trajectories, users do not need to use it. |
Note: Using Transform is a VERY tricky thing to do. Transform uses template argument to duplicate itself into two different types, one for CPU, another for CUDA. The trick is not without its flaw:
If you use it in a function that can be compiled by both nvcc and host compiler, the behaviour is un-defined! Because your function is NOT duplicated by CompiledWithCuda
. At link time, cuda compiler resolution will merge functions with same signature.
|
inlinestatic |
Initialize a Transform object.
Functor | A callable object type. |
func | A callable object, accepting a size_t thread index, followed by a set of Span classes. |
range | Range object specifying parallel threads index range. |
devices | GPUSet specifying GPUs to use, when compiling for CPU, this should be GPUSet::Empty(). |
shard | Whether Shard for HostDeviceVector is needed. |
|
inlinestatic |