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:
Jiaming Yuan
2022-01-04 22:12:15 +08:00
committed by GitHub
parent 5516281881
commit 68cdbc9c16
6 changed files with 68 additions and 68 deletions

View File

@@ -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

View File

@@ -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;
/**