MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / getBufferSizeExpr

Method getBufferSizeExpr

src/library/tools/ktest/ktest.cpp:582–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580}
581
582void
583KTest::getBufferSizeExpr(Variable *buffer, std::string& size)
584{
585 ArrayVariableInterface *hostPtr = (ArrayVariableInterface*)(buffer->hostPtr());
586 if (hostPtr->isMatrix()) {
587 MatrixVariable *ptrVar = (MatrixVariable*)hostPtr;
588 if (masterStep_->matrixSize(ptrVar).empty()) {
589 size += "sizeof(";
590 size += ptrVar->type();
591 size += ")";
592 }
593 else {
594 size = "(";
595 size += masterStep_->matrixSize(ptrVar);
596 size += ") * sizeof(*";
597 size += ptrVar->name();
598 size += ")";
599 }
600 }
601 else {
602 VectorVariable *ptrVar = (VectorVariable*)buffer->hostPtr();
603 size = "(";
604 size += masterStep_->vectorSize(ptrVar);
605 size += ") * sizeof(*";
606 size += ptrVar->name();
607 size += ")";
608 }
609}
610
611void
612KTest::allocateWriteBuffers(std::stringstream& ss)

Callers

nothing calls this directly

Calls 4

hostPtrMethod · 0.80
matrixSizeMethod · 0.80
vectorSizeMethod · 0.80
isMatrixMethod · 0.45

Tested by

no test coverage detected