TiledArray  0.7.0
TiledArray::math::GemmHelper Class Reference

Contraction to *GEMM helper. More...

#include <gemm_helper.h>

Public Member Functions

 GemmHelper (const madness::cblas::CBLAS_TRANSPOSE left_op, const madness::cblas::CBLAS_TRANSPOSE right_op, const unsigned int result_rank, const unsigned int left_rank, const unsigned int right_rank)
 
 GemmHelper (const GemmHelper &other)
 Functor copy constructor. More...
 
GemmHelperoperator= (const GemmHelper &other)
 Functor assignment operator. More...
 
unsigned int num_contract_ranks () const
 Compute the number of contracted ranks. More...
 
unsigned int result_rank () const
 Result rank accessor. More...
 
unsigned int left_rank () const
 Left-hand argument rank accessor. More...
 
unsigned int right_rank () const
 Right-hand argument rank accessor. More...
 
unsigned int left_inner_begin () const
 
unsigned int left_inner_end () const
 
unsigned int left_outer_begin () const
 
unsigned int left_outer_end () const
 
unsigned int right_inner_begin () const
 
unsigned int right_inner_end () const
 
unsigned int right_outer_begin () const
 
unsigned int right_outer_end () const
 
template<typename R , typename Left , typename Right >
make_result_range (const Left &left, const Right &right) const
 Construct a result range based on left and right ranges. More...
 
template<typename Left , typename Result >
bool left_result_congruent (const Left &left, const Result &result) const
 Test that the outer dimensions of left are congruent (have equal extent) with that of the result tensor. More...
 
template<typename Right , typename Result >
bool right_result_congruent (const Right &right, const Result &result) const
 Test that the outer dimensions of right are congruent (have equal extent) with that of the result tensor. More...
 
template<typename Left , typename Right >
bool left_right_congruent (const Left &left, const Right &right) const
 Test that the inner dimensions of left are congruent (have equal extent) with that of right. More...
 
template<typename Left , typename Right >
void compute_matrix_sizes (integer &m, integer &n, integer &k, const Left &left, const Right &right) const
 Compute the matrix dimension that can be used in a *GEMM call. More...
 
madness::cblas::CBLAS_TRANSPOSE left_op () const
 
madness::cblas::CBLAS_TRANSPOSE right_op () const
 

Detailed Description

Contraction to *GEMM helper.

This object is used to convert tensor contraction to *GEMM operations by providing information on how to fuse dimensions

Definition at line 39 of file gemm_helper.h.

Constructor & Destructor Documentation

◆ GemmHelper() [1/2]

TiledArray::math::GemmHelper::GemmHelper ( const madness::cblas::CBLAS_TRANSPOSE  left_op,
const madness::cblas::CBLAS_TRANSPOSE  right_op,
const unsigned int  result_rank,
const unsigned int  left_rank,
const unsigned int  right_rank 
)
inline

Definition at line 64 of file gemm_helper.h.

Here is the call graph for this function:

◆ GemmHelper() [2/2]

TiledArray::math::GemmHelper::GemmHelper ( const GemmHelper other)
inline

Functor copy constructor.

Shallow copy of this functor

Parameters
otherThe functor to be copied

Definition at line 105 of file gemm_helper.h.

Member Function Documentation

◆ compute_matrix_sizes()

template<typename Left , typename Right >
void TiledArray::math::GemmHelper::compute_matrix_sizes ( integer &  m,
integer &  n,
integer &  k,
const Left &  left,
const Right &  right 
) const
inline

Compute the matrix dimension that can be used in a *GEMM call.

Template Parameters
LeftThe left-hand range type
RightThe right-hand range type
Parameters
[out]mThe number of rows in left-hand and result matrices
[out]nThe number of columns in the right-hand result matrices
[out]kThe number of columns in the left-hand matrix and the number of rows in the right-hand matrix
[in]leftThe left-hand range object
[in]rightThe right-hand range object

Definition at line 252 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_inner_begin()

unsigned int TiledArray::math::GemmHelper::left_inner_begin ( ) const
inline

Definition at line 146 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_inner_end()

unsigned int TiledArray::math::GemmHelper::left_inner_end ( ) const
inline

Definition at line 147 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_op()

madness::cblas::CBLAS_TRANSPOSE TiledArray::math::GemmHelper::left_op ( ) const
inline

Definition at line 273 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_outer_begin()

unsigned int TiledArray::math::GemmHelper::left_outer_begin ( ) const
inline

Definition at line 148 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_outer_end()

unsigned int TiledArray::math::GemmHelper::left_outer_end ( ) const
inline

Definition at line 149 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_rank()

unsigned int TiledArray::math::GemmHelper::left_rank ( ) const
inline

Left-hand argument rank accessor.

Returns
The rank of the left-hand tile

Definition at line 139 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_result_congruent()

template<typename Left , typename Result >
bool TiledArray::math::GemmHelper::left_result_congruent ( const Left &  left,
const Result &  result 
) const
inline

Test that the outer dimensions of left are congruent (have equal extent) with that of the result tensor.

This function can test the start, finish, or size arrays of range objects.

Template Parameters
LeftThe left-hand size array type
ResultThe result size array type
Parameters
leftThe left-hand size array to be tested
resultThe result size array to be tested
Returns
true if The outer dimensions of left are congruent with that of result

Definition at line 205 of file gemm_helper.h.

Here is the caller graph for this function:

◆ left_right_congruent()

template<typename Left , typename Right >
bool TiledArray::math::GemmHelper::left_right_congruent ( const Left &  left,
const Right &  right 
) const
inline

Test that the inner dimensions of left are congruent (have equal extent) with that of right.

This function can test the start, finish, or size arrays of range objects.

Template Parameters
LeftThe left-hand size array type
RightThe right-hand size array type
Parameters
leftThe left-hand size array to be tested
rightThe right-hand size array to be tested
Returns
true if the outer dimensions of left are congruent with that of right, other false.

Definition at line 236 of file gemm_helper.h.

Here is the caller graph for this function:

◆ make_result_range()

template<typename R , typename Left , typename Right >
R TiledArray::math::GemmHelper::make_result_range ( const Left &  left,
const Right &  right 
) const
inline

Construct a result range based on left and right ranges.

Template Parameters
RThe result range type
LeftThe left-hand range type
RightThe right-hand range type
Parameters
leftThe left-hand range
rightThe right-hand range
Returns
A range object that can be used in a tensor contraction defined by this object

Definition at line 166 of file gemm_helper.h.

Here is the caller graph for this function:

◆ num_contract_ranks()

unsigned int TiledArray::math::GemmHelper::num_contract_ranks ( ) const
inline

Compute the number of contracted ranks.

Returns
The number of ranks that are summed by this operation

Definition at line 127 of file gemm_helper.h.

Here is the caller graph for this function:

◆ operator=()

GemmHelper& TiledArray::math::GemmHelper::operator= ( const GemmHelper other)
inline

Functor assignment operator.

Parameters
otherThe functor to be copied

Definition at line 114 of file gemm_helper.h.

◆ result_rank()

unsigned int TiledArray::math::GemmHelper::result_rank ( ) const
inline

Result rank accessor.

Returns
The rank of the result tile

Definition at line 134 of file gemm_helper.h.

Here is the caller graph for this function:

◆ right_inner_begin()

unsigned int TiledArray::math::GemmHelper::right_inner_begin ( ) const
inline

Definition at line 151 of file gemm_helper.h.

◆ right_inner_end()

unsigned int TiledArray::math::GemmHelper::right_inner_end ( ) const
inline

Definition at line 152 of file gemm_helper.h.

◆ right_op()

madness::cblas::CBLAS_TRANSPOSE TiledArray::math::GemmHelper::right_op ( ) const
inline

Definition at line 274 of file gemm_helper.h.

Here is the caller graph for this function:

◆ right_outer_begin()

unsigned int TiledArray::math::GemmHelper::right_outer_begin ( ) const
inline

Definition at line 153 of file gemm_helper.h.

Here is the caller graph for this function:

◆ right_outer_end()

unsigned int TiledArray::math::GemmHelper::right_outer_end ( ) const
inline

Definition at line 154 of file gemm_helper.h.

Here is the caller graph for this function:

◆ right_rank()

unsigned int TiledArray::math::GemmHelper::right_rank ( ) const
inline

Right-hand argument rank accessor.

Returns
The rank of the right-hand tile

Definition at line 144 of file gemm_helper.h.

Here is the caller graph for this function:

◆ right_result_congruent()

template<typename Right , typename Result >
bool TiledArray::math::GemmHelper::right_result_congruent ( const Right &  right,
const Result &  result 
) const
inline

Test that the outer dimensions of right are congruent (have equal extent) with that of the result tensor.

This function can test the start, finish, or size arrays of range objects.

Template Parameters
RightThe right-hand size array type
ResultThe result size array type
Parameters
rightThe right-hand size array to be tested
resultThe result size array to be tested
Returns
true if The outer dimensions of right are congruent with that of result

Definition at line 220 of file gemm_helper.h.

Here is the caller graph for this function:

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