(aggFunc C.enum_AggregateFunction, outputWidthInByte int)
| 365 | } |
| 366 | |
| 367 | func (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 | |
| 395 | func (bc *oopkBatchContext) makeWriteToDimensionVectorAction(valueOffset, nullOffset, prevResultSize int) rootAction { |
| 396 | return func(functorType uint32, stream unsafe.Pointer, device int, inputs []C.InputVector, exp expr.Expr) { |
no test coverage detected