| 59 | using namespace NCB; |
| 60 | |
| 61 | static THolder<NPar::ILocalExecutor> CreateLocalExecutor(const NCatboostOptions::TCatBoostOptions& catBoostOptions) { |
| 62 | const bool isGpuDeviceType = catBoostOptions.GetTaskType() == ETaskType::GPU; |
| 63 | const int threadCount = catBoostOptions.SystemOptions.Get().NumThreads.Get(); |
| 64 | if (isGpuDeviceType && TTrainerFactory::Has(ETaskType::GPU)) { |
| 65 | auto localExecutorHolder = MakeHolder<NPar::TLocalExecutor>(); |
| 66 | localExecutorHolder->RunAdditionalThreads(threadCount - 1); |
| 67 | return localExecutorHolder; |
| 68 | } else { |
| 69 | return MakeHolder<NPar::TTbbLocalExecutor<>>(threadCount); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | static void ShrinkModel(int itCount, const TCtrHelper& ctrsHelper, TLearnProgress* progress) { |
| 74 | itCount += SafeIntegerCast<int>(progress->InitTreesSize); |
no test coverage detected