MCPcopy
hub / github.com/uber/aresdb / makeWriteToMeasureVectorAction

Method makeWriteToMeasureVectorAction

query/time_series_aggregate.go:367–393  ·  view source on GitHub ↗
(aggFunc C.enum_AggregateFunction, outputWidthInByte int)

Source from the content-addressed store, hash-verified

365}
366
367func (bc *oopkBatchContext) makeWriteToMeasureVectorAction(aggFunc C.enum_AggregateFunction, outputWidthInByte int) rootAction {
368 return func(functorType uint32, stream unsafe.Pointer, device int, inputs []C.InputVector, exp expr.Expr) {
369 // If current batch size is already 0, short circuit to avoid issuing a noop cuda call.
370 if bc.size <= 0 {
371 return
372 }
373 measureVector := utils.MemAccess(bc.measureVectorD[0].getPointer(), bc.resultSize*outputWidthInByte)
374 // write measure out to measureVectorD[1] for hll query
375 if aggFunc == C.AGGR_HLL {
376 measureVector = bc.measureVectorD[1].getPointer()
377 }
378 outputVector := makeMeasureVectorOutput(measureVector, getOutputDataType(exp.Type(), outputWidthInByte), aggFunc)
379
380 if len(inputs) == 1 {
381 doCGoCall(func() C.CGoCallResHandle {
382 return C.UnaryTransform(inputs[0], outputVector, (*C.uint32_t)(bc.indexVectorD.getPointer()),
383 (C.int)(bc.size), (*C.uint32_t)(bc.baseCountD.getPointer()), (C.uint32_t)(bc.startRow), functorType, stream, C.int(device))
384 })
385 } else if len(inputs) == 2 {
386 doCGoCall(func() C.CGoCallResHandle {
387 return C.BinaryTransform(inputs[0], inputs[1], outputVector,
388 (*C.uint32_t)(bc.indexVectorD.getPointer()), (C.int)(bc.size), (*C.uint32_t)(bc.baseCountD.getPointer()), (C.uint32_t)(bc.startRow),
389 functorType, stream, C.int(device))
390 })
391 }
392 }
393}
394
395func (bc *oopkBatchContext) makeWriteToDimensionVectorAction(valueOffset, nullOffset, prevResultSize int) rootAction {
396 return func(functorType uint32, stream unsafe.Pointer, device int, inputs []C.InputVector, exp expr.Expr) {

Callers 2

evalMeasuresMethod · 0.80

Calls 6

MemAccessFunction · 0.92
makeMeasureVectorOutputFunction · 0.85
getOutputDataTypeFunction · 0.85
getPointerMethod · 0.80
doCGoCallFunction · 0.70
TypeMethod · 0.65

Tested by

no test coverage detected