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

Class for performing blocked matrix multiplication. More...

#include <functions.h>

Inheritance diagram for MatrixMultiply_Block:
MLFunction

Public Member Functions

 MatrixMultiply_Block (int num_rows, int num_cols, int num_samples, int blocks)
 Constructor for MatrixMultiply_Block.
 
void apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &type, exec::EvalCtx &context, VectorPtr &output) const override
 Apply the blocked matrix multiplication operation.
 
float * getTensor () const override
 Get the tensor data associated with this function.
 
std::string getFuncName ()
 Get the name 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.
 
virtual CostEstimate getCost (std::vector< int > inputDims)
 Estimates the computational cost of applying the function.
 

Static Public Member Functions

static std::vector< std::shared_ptr< exec::FunctionSignature > > signatures ()
 Get the function signatures for blocked 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 blocked matrix multiplication.

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

Constructor & Destructor Documentation

◆ MatrixMultiply_Block()

MatrixMultiply_Block::MatrixMultiply_Block ( int num_rows,
int num_cols,
int num_samples,
int blocks )
inline

Constructor for MatrixMultiply_Block.

Parameters
num_rowsThe number of rows in the matrix.
num_colsThe number of columns in the matrix.
num_samplesThe number of samples.
blocksThe number of blocks for partitioning the matrix.

Member Function Documentation

◆ apply()

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

Apply the blocked matrix multiplication operation.

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

◆ getFuncName()

std::string MatrixMultiply_Block::getFuncName ( )
inlinevirtual

Get the name of the function.

Returns
A string representing the function name.

Reimplemented from MLFunction.

◆ getName()

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

Get the name of the function.

Returns
A string representing the function name.

◆ getTensor()

float * MatrixMultiply_Block::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_Block::signatures ( )
inlinestatic

Get the function signatures for blocked matrix multiplication.

Returns
A vector of function signatures.

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