Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF_int::contraction Class Reference

class for execution distributed contraction of tensors More...

#include <contraction.h>

Collaboration diagram for CTF_int::contraction:

Public Member Functions

 contraction ()
 lazy constructor More...
 
 ~contraction ()
 destructor More...
 
 contraction (contraction const &other)
 copy constructor More...
 
 contraction (tensor *A, int const *idx_A, tensor *B, int const *idx_B, char const *alpha, tensor *C, int const *idx_C, char const *beta, bivar_function const *func=NULL)
 constructor definining contraction with C's mul and add ops More...
 
 contraction (tensor *A, char const *idx_A, tensor *B, char const *idx_B, char const *alpha, tensor *C, char const *idx_C, char const *beta, bivar_function const *func=NULL)
 
void execute ()
 run contraction More...
 
double estimate_time ()
 predicts execution time in seconds using performance models More...
 
int is_equal (contraction const &os)
 returns 1 if contractions have same tensors and index map More...
 

Data Fields

tensorA
 left operand More...
 
tensorB
 right operand More...
 
tensorC
 output More...
 
char const * alpha
 scaling of A*B More...
 
char const * beta
 scaling of existing C More...
 
int * idx_A
 indices of left operand More...
 
int * idx_B
 indices of right operand More...
 
int * idx_C
 indices of output More...
 
bool is_custom
 whether there is a elementwise custom function More...
 
bivar_function const * func
 function to execute on elements More...
 

Detailed Description

class for execution distributed contraction of tensors

Definition at line 16 of file contraction.h.

Constructor & Destructor Documentation

CTF_int::contraction::contraction ( )
inline

lazy constructor

Definition at line 42 of file contraction.h.

References A, B, C, CTF_int::ctr_2d_gen_build(), estimate_time(), execute(), is_equal(), and ~contraction().

CTF_int::contraction::~contraction ( )

destructor

Definition at line 29 of file contraction.cxx.

References CTF_int::cdealloc().

Referenced by contraction().

CTF_int::contraction::contraction ( contraction const &  other)

copy constructor

Parameters
[in]otherobject to copy

Definition at line 35 of file contraction.cxx.

References A, CTF_int::alloc(), alpha, B, beta, C, func, idx_A, idx_B, idx_C, is_custom, and CTF_int::tensor::order.

CTF_int::contraction::contraction ( tensor A,
int const *  idx_A,
tensor B,
int const *  idx_B,
char const *  alpha,
tensor C,
int const *  idx_C,
char const *  beta,
bivar_function const *  func = NULL 
)

constructor definining contraction with C's mul and add ops

Parameters
[in]Aleft operand tensor
[in]idx_Aindices of left operand
[in]Bright operand tensor
[in]idx_Bindices of right operand
[in]alphascaling factor (can be NULL) alpha * A[idx_A] * B[idx_B];
[in]Couput operand tensor
[in]idx_Cindices of right operand
[in]betascaling factor of output (can be NULL) C[idx_C] = beta*C[idx_C]
  • alpha * A[idx_A] * B[idx_B]; constructor definining contraction with custom function
[in]Aleft operand tensor
[in]idx_Aindices of left operand
[in]Bright operand tensor
[in]idx_Bindices of right operand
[in]alphascaling factor (can be NULL) alpha * A[idx_A] * B[idx_B];
[in]Couput operand tensor
[in]idx_Cindices of right operand
[in]betascaling factor of output (can be NULL) C[idx_C] = beta*C[idx_C]
  • alpha * A[idx_A] * B[idx_B];
[in]funccustom elementwise function func(A[idx_A],B[idx_B],&C[idx_C])

Definition at line 52 of file contraction.cxx.

References CTF_int::alloc().

CTF_int::contraction::contraction ( tensor A,
char const *  idx_A,
tensor B,
char const *  idx_B,
char const *  alpha,
tensor C,
char const *  idx_C,
char const *  beta,
bivar_function const *  func = NULL 
)

Definition at line 78 of file contraction.cxx.

References CTF_int::conv_idx().

Member Function Documentation

double CTF_int::contraction::estimate_time ( )

predicts execution time in seconds using performance models

Definition at line 163 of file contraction.cxx.

Referenced by CTF_int::contract_down_terms(), contraction(), CTF_int::Bifun_Term::estimate_time(), CTF_int::Contract_Term::estimate_time(), and CTF::Tensor< dtype >::operator=().

int CTF_int::contraction::is_equal ( contraction const &  os)

returns 1 if contractions have same tensors and index map

Parameters
[in]oscontraction object to compare this with

Definition at line 168 of file contraction.cxx.

References A, B, C, idx_A, idx_B, and idx_C.

Referenced by contraction().

Field Documentation

char const* CTF_int::contraction::alpha
char const* CTF_int::contraction::beta

scaling of existing C

Definition at line 28 of file contraction.h.

Referenced by contraction(), CTF_int::ctr::ctr(), and CTF_int::get_len_ordering().

bivar_function const* CTF_int::contraction::func

function to execute on elements

Definition at line 39 of file contraction.h.

Referenced by contraction(), CTF_int::seq_tsr_ctr::seq_tsr_ctr(), and CTF_int::seq_tsr_spctr::seq_tsr_spctr().

bool CTF_int::contraction::is_custom

whether there is a elementwise custom function

Definition at line 37 of file contraction.h.

Referenced by contraction(), CTF_int::seq_tsr_ctr::seq_tsr_ctr(), and CTF_int::seq_tsr_spctr::seq_tsr_spctr().


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