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

Function TailImpl

catboost/cuda/cuda_util/helpers.cpp:125–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124template <class T>
125static TDistributedObject<std::remove_const_t<T>> TailImpl(const TCudaBuffer<T, TStripeMapping>& data, ui32 stream) {
126 Y_ASSERT(data.GetObjectsSlice().Size());
127 auto result = TCudaBuffer<std::remove_const_t<T>, TStripeMapping, EPtrType::CudaHost>::Create(data.GetMapping().RepeatOnAllDevices(1, data.GetMapping().SingleObjectSize()));
128
129 using TKernel = TTailKernel<std::remove_const_t<T>, EPtrType::CudaHost>;
130 LaunchKernels<TKernel>(result.NonEmptyDevices(), stream, data, result);
131
132 TVector<std::remove_const_t<T>> resultVec;
133 result.Read(resultVec, stream);
134 auto res = CreateDistributedObject<std::remove_const_t<T>>(0);
135 for (ui32 i = 0; i < NCudaLib::GetCudaManager().GetDeviceCount(); ++i) {
136 res.Set(i, resultVec[i]);
137 }
138 return res;
139}
140
141#define Y_CATBOOST_CUDA_F_IMPL(T) \
142 template <> \

Callers

nothing calls this directly

Calls 10

GetMappingMethod · 0.80
SingleObjectSizeMethod · 0.80
CreateFunction · 0.50
SizeMethod · 0.45
GetObjectsSliceMethod · 0.45
RepeatOnAllDevicesMethod · 0.45
NonEmptyDevicesMethod · 0.45
ReadMethod · 0.45
GetDeviceCountMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected