MCPcopy Create free account
hub / github.com/catboost/catboost / CreateLocalExecutor

Function CreateLocalExecutor

catboost/libs/train_lib/train_model.cpp:61–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59using namespace NCB;
60
61static 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
73static void ShrinkModel(int itCount, const TCtrHelper& ctrsHelper, TLearnProgress* progress) {
74 itCount += SafeIntegerCast<int>(progress->InitTreesSize);

Callers 1

TrainModelFunction · 0.85

Calls 4

HasFunction · 0.85
GetTaskTypeMethod · 0.80
RunAdditionalThreadsMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected