| 31 | } |
| 32 | |
| 33 | NCatboostCuda::TTreeCtrDataSetBuilder::TConstVec NCatboostCuda::TTreeCtrDataSetBuilder::GetBorders(const NCatboostCuda::TCtr& ctr, |
| 34 | const NCatboostCuda::TTreeCtrDataSetBuilder::TVec& floatCtr, |
| 35 | ui32 stream) { |
| 36 | CB_ENSURE(TreeCtrDataSet.InverseCtrIndex.contains(ctr)); |
| 37 | const ui32 featureId = TreeCtrDataSet.InverseCtrIndex[ctr]; |
| 38 | const auto& bordersSlice = TreeCtrDataSet.CtrBorderSlices[featureId]; |
| 39 | |
| 40 | if (TreeCtrDataSet.AreCtrBordersComputed[featureId] == false) { |
| 41 | const auto& binarizationDescription = TreeCtrDataSet.FeaturesManager.GetCtrBinarization(ctr); |
| 42 | TCudaBuffer<float, NCudaLib::TSingleMapping> bordersVecSlice = TreeCtrDataSet.CtrBorders.SliceView(bordersSlice); |
| 43 | ComputeCtrBorders(floatCtr, |
| 44 | binarizationDescription, |
| 45 | stream, |
| 46 | bordersVecSlice); |
| 47 | TreeCtrDataSet.AreCtrBordersComputed[featureId] = true; |
| 48 | } |
| 49 | return TreeCtrDataSet.CtrBorders.SliceView(bordersSlice).AsConstBuf(); |
| 50 | } |
| 51 | |
| 52 | void NCatboostCuda::TTreeCtrDataSetBuilder::ComputeCtrBorders(const NCatboostCuda::TTreeCtrDataSetBuilder::TVec& ctr, |
| 53 | const NCatboostOptions::TBinarizationOptions& binarizationDescription, |