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

Method Run

catboost/cuda/targets/kernel.h:292–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290 }
291
292 void Run(const TCudaStream& stream, TKernelContext& context) {
293 if (FunctionValue.Size()) {
294 NKernel::FillBuffer(FunctionValue.Get(), 0.0f, 1, stream.GetStream());
295 }
296 if (Predictions.Size() == 0) {
297 return;
298 }
299
300 if (Der.Size()) {
301 CB_ENSURE(Der.Size() == Predictions.Size());
302 }
303 CB_ENSURE(QuerySizes.Size() == QueryOffsets.Size());
304 if (Indices.Size()) {
305 CB_ENSURE(Indices.Size() == Predictions.Size());
306 NKernel::Gather(context.ApproxExp.Get(), Predictions.Get(), Indices.Get(), Indices.Size(), stream.GetStream());
307 } else {
308 CopyMemoryAsync(Predictions.Get(), context.ApproxExp.Get(), Predictions.Size(), stream);
309 }
310
311 NKernel::ComputeGroupIds(QuerySizes.Get(), QueryOffsets.Get(), QueryOffsetsBias, QueryOffsets.Size(), context.Qids.Get(), stream.GetStream());
312 NKernel::ComputeGroupMaximals(Relevs.Get(),
313 Weights.Get(),
314 context.ApproxExp.Get(),
315 QueryOffsets.Get(),
316 QueryOffsetsBias,
317 QuerySizes.Get(),
318 QueryOffsets.Size(),
319 context.QueryApprox.Get(),
320 context.QuerySumWeightedTargets.Get(),
321 stream.GetStream());
322 NKernel::ComputeQueryExponents(Weights.Get(),
323 context.Qids.Get(),
324 static_cast<ui32>(Predictions.Size()),
325 context.QueryApprox.Get(),
326 Indices.Get(),
327 context.ApproxExp.Get(),
328 Beta,
329 stream.GetStream());
330 NKernel::ComputeGroupSums(context.ApproxExp.Get(),
331 QueryOffsets.Get(),
332 QueryOffsetsBias,
333 QuerySizes.Get(),
334 QueryOffsets.Size(),
335 context.QueryApprox.Get(),
336 stream.GetStream());
337
338 NKernel::ApproximateQuerySoftMax(Relevs.Get(),
339 Weights.Get(),
340 context.ApproxExp.Get(),
341 context.Qids.Get(),
342 LambdaReg,
343 Beta,
344 static_cast<ui32>(Predictions.Size()),
345 context.QueryApprox.Get(),
346 context.QuerySumWeightedTargets.Get(),
347 Indices.Get(),
348 FunctionValue.Get(),
349 Der.Get(),

Callers

nothing calls this directly

Calls 6

GatherFunction · 0.85
CopyMemoryAsyncFunction · 0.85
ApproximateQuerySoftMaxFunction · 0.85
SizeMethod · 0.45
GetMethod · 0.45
GetStreamMethod · 0.45

Tested by

no test coverage detected