Remove omp_get_max_threads in CPU predictor. (#7519)
This is part of the on going effort to remove the dependency on global omp variables.
This commit is contained in:
@@ -24,7 +24,7 @@ struct GenericParameter : public XGBoostParameter<GenericParameter> {
|
||||
bool seed_per_iteration;
|
||||
// number of threads to use if OpenMP is enabled
|
||||
// if equals 0, use system default
|
||||
int nthread;
|
||||
int nthread{0};
|
||||
// primary device, -1 means no gpu.
|
||||
int gpu_id;
|
||||
// fail when gpu_id is invalid
|
||||
|
||||
@@ -105,11 +105,11 @@ class Predictor {
|
||||
/*
|
||||
* \brief Runtime parameters.
|
||||
*/
|
||||
GenericParameter const* generic_param_;
|
||||
GenericParameter const* ctx_;
|
||||
|
||||
public:
|
||||
explicit Predictor(GenericParameter const* generic_param) :
|
||||
generic_param_{generic_param} {}
|
||||
explicit Predictor(GenericParameter const* ctx) : ctx_{ctx} {}
|
||||
|
||||
virtual ~Predictor() = default;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user