Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-21 23:14:24

0001 #!/usr/bin/perl
0002 
0003 use lib "..";
0004 
0005 use GenMul;
0006 
0007 ### If you're going to run GMtest.cxx and you do some changes here
0008 ### you *MUST* bring DIM, DOM and pattern assumptions in sync!
0009 
0010 my $DIM = 3;
0011 my $DOM = 6;
0012 
0013 $a = new GenMul::MatrixSym('name'=>'a', 'M'=>$DIM);
0014 $a->set_pattern(<<"FNORD");
0015 x
0016 x 1 
0017 x x x
0018 FNORD
0019 
0020 $b = new GenMul::Matrix('name'=>'b', 'M'=>$DIM, 'N'=>$DOM);
0021 $b->set_pattern(<<"FNORD");
0022 x x x x 0 x
0023 x 1 x 1 0 x
0024 x x x x 0 x
0025 FNORD
0026 
0027 $c = new GenMul::Matrix('name'=>'c', 'M'=>$DIM, 'N'=>$DOM);
0028 
0029 
0030 $bt = new GenMul::MatrixTranspose($b);
0031 $bt->print_info();
0032 $bt->print_pattern();
0033 
0034 $ct = new GenMul::Matrix('name'=>'c', 'M'=>$DOM, 'N'=>$DIM);
0035 
0036 # ----------------------------------------------------------------------
0037 
0038 # E.g. to skip matrix size check:
0039 #   $m = new GenMul::Multiply('no_size_check'=>1);
0040 # Note that matrix dimensions that you pass into auto-generated
0041 # function still has to match matrix dimensions set here.
0042 
0043 $m = new GenMul::Multiply;
0044 
0045 $m->dump_multiply_std_and_intrinsic("multify.ah", $a, $b, $c);
0046 
0047 $m->dump_multiply_std_and_intrinsic("multify-transpose.ah", $bt, $a, $ct);
0048 
0049 # To separate outputs of each function:
0050 #
0051 # open STD, ">multify.ah";
0052 # select STD;
0053 
0054 # $m->multiply_standard($a, $b, $c);
0055 
0056 # close STD;
0057 
0058 # # print "\n", '-' x 80, "\n\n";
0059 
0060 # open INT, ">multify_intr.ah";
0061 # select INT;
0062 
0063 # $m->multiply_intrinsic($a, $b, $c);
0064 
0065 # close INT;