ML functions
 
Loading...
Searching...
No Matches
MatrixMultiply_h Class Reference

Class for performing matrix multiplication with a hierarchical approach. More...

#include <functions.h>

Inheritance diagram for MatrixMultiply_h:
MLFunction

Public Member Functions

 MatrixMultiply_h (int num_rows, int num_cols, int block_size)
 Constructor for MatrixMultiply_h.
 
void apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &outputType, exec::EvalCtx &context, VectorPtr &output) const override
 Apply the hierarchical matrix multiplication operation.
 
float * getTensor () const override
 Get the tensor data associated with this function.
 
std::string getFuncName ()
 Get the name of the function.
 
CostEstimate getCost (std::vector< int > inputDims)
 Estimate the computational cost of the function.
 
- Public Member Functions inherited from MLFunction
virtual ~MLFunction ()=default
 Virtual destructor.
 
virtual std::vector< int > getDims ()
 Returns the dimensions of the function.
 
virtual int getNumDims ()
 Returns the number of dimensions of the function.
 

Static Public Member Functions

static std::vector< std::shared_ptr< exec::FunctionSignature > > signatures ()
 Get the function signatures for hierarchical matrix multiplication.
 
static std::string getName ()
 Get the name of the function.
 

Additional Inherited Members

- Protected Member Functions inherited from MLFunction
double getWeightedCost (std::string name, float cost)
 Calculates the weighted cost of the function.
 
std::vector< double > getCoefficientVector (std::string name)
 Retrieves the cost coefficients for the function.
 
- Protected Attributes inherited from MLFunction
std::vector< int > dims
 Dimensions of the function.
 

Detailed Description

Class for performing matrix multiplication with a hierarchical approach.

This class implements matrix multiplication using a hierarchical approach, which is useful for optimizing performance on large matrices by breaking the computation into smaller blocks.

Constructor & Destructor Documentation

◆ MatrixMultiply_h()

MatrixMultiply_h::MatrixMultiply_h ( int num_rows,
int num_cols,
int block_size )
inline

Constructor for MatrixMultiply_h.

Parameters
num_rowsThe number of rows in the matrix.
num_colsThe number of columns in the matrix.
block_sizeThe size of each block for hierarchical computation.

Member Function Documentation

◆ apply()

void MatrixMultiply_h::apply ( const SelectivityVector & rows,
std::vector< VectorPtr > & args,
const TypePtr & outputType,
exec::EvalCtx & context,
VectorPtr & output ) const
inlineoverride

Apply the hierarchical matrix multiplication operation.

Parameters
rowsThe selectivity vector indicating which rows to process.
argsThe input arguments.
outputTypeThe type of the output vector.
contextThe evaluation context.
outputThe output vector.

◆ getCost()

CostEstimate MatrixMultiply_h::getCost ( std::vector< int > inputDims)
inlinevirtual

Estimate the computational cost of the function.

Parameters
inputDimsThe dimensions of the input data.
Returns
A CostEstimate object representing the estimated cost.

Reimplemented from MLFunction.

◆ getFuncName()

std::string MatrixMultiply_h::getFuncName ( )
inlinevirtual

Get the name of the function.

Returns
A string representing the function name.

Reimplemented from MLFunction.

◆ getName()

static std::string MatrixMultiply_h::getName ( )
inlinestatic

Get the name of the function.

Returns
A string representing the function name.

◆ getTensor()

float * MatrixMultiply_h::getTensor ( ) const
inlineoverridevirtual

Get the tensor data associated with this function.

Returns
A pointer to the tensor data.

Implements MLFunction.

◆ signatures()

static std::vector< std::shared_ptr< exec::FunctionSignature > > MatrixMultiply_h::signatures ( )
inlinestatic

Get the function signatures for hierarchical matrix multiplication.

Returns
A vector of function signatures.

The documentation for this class was generated from the following file: