User Tools

Site Tools


schedule_code_generator_for_code_with_subsystem

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
schedule_code_generator_for_code_with_subsystem [2014/07/07 14:56]
yun [TargetMapping for the Matrix Multiplication Example]
schedule_code_generator_for_code_with_subsystem [2014/07/07 15:38]
yun [TargetMapping for Optimization]
Line 41: Line 41:
  
 The following command set the SpaceTimeMap for the (n)th input/output of a useEuqation identified with lable: The following command set the SpaceTimeMap for the (n)th input/output of a useEuqation identified with lable:
-<sxh alphabets; gutter:false>+<sxh cs; gutter:false>
 setSpaceTimeMapForUseEquationOptimization(program, system, label, isInput, n, SpaceTimeMapForMalloc, SpaceTimeMapForValueCopy, SpaceTimeMapForMemoryFree); setSpaceTimeMapForUseEquationOptimization(program, system, label, isInput, n, SpaceTimeMapForMalloc, SpaceTimeMapForValueCopy, SpaceTimeMapForMemoryFree);
 </sxh> </sxh>
 The parameter isInput sepcifies whether the SpaceTimeMap is specified for input or not, and the last three prarameter specifies the space time map for the three special statement attached to the current input/output. Those specification can also be specified separately with the following command: The parameter isInput sepcifies whether the SpaceTimeMap is specified for input or not, and the last three prarameter specifies the space time map for the three special statement attached to the current input/output. Those specification can also be specified separately with the following command:
-<sxh alphabets; gutter:false>+<sxh cs; gutter:false>
 setSpaceTimeMapForMemoryAllocation(program, system, label, isInput, n, SpaceTimeMap); setSpaceTimeMapForMemoryAllocation(program, system, label, isInput, n, SpaceTimeMap);
 setSpaceTimeMapForValueCopy(program, system, label, isInput, n, SpaceTimeMap); setSpaceTimeMapForValueCopy(program, system, label, isInput, n, SpaceTimeMap);
Line 52: Line 52:
  
 The following script consists all the commands that specifies the TargetMapping for the matrix multiplication example and generates the code. The following script consists all the commands that specifies the TargetMapping for the matrix multiplication example and generates the code.
-<sxh alphabets; gutter:false>+<sxh cs; gutter:false>
 prog = ReadAlphabets("./Matrix_product_SubSyst.ab"); prog = ReadAlphabets("./Matrix_product_SubSyst.ab");
 rootSystem = "matrix_product_SubSyst"; rootSystem = "matrix_product_SubSyst";
Line 86: Line 86:
 </sxh> </sxh>
  
 +====TargetMapping for Optimization====
 +The schedule code generator generates three special statements for each input/output of each useEquation. However, those special statements can be saved under some situation. For example,  the <iP, jP>th value of the final matrix C is computed by a dot product of the <iP>th row of matrix A and the <jP>th column of matrix B
 +by the <iP, jP>th instance of the use equation. Assume that the memory for matrix A, B and C are all allocated in row-wise major, the <iP>th row of matrix A can be passed as a pointer of A, no temporary variable is needed. This can be achieved by specifying the memory space for the first input of the useEquation to be the same as A. 
  
 +The following command is the command that specifies the optimization for the first input of the useEquation C.
 +<sxh cs; gutter:false>
 +setMemorySpaceForUseEuqationOptimization(prog, rootSystem, label, 0, 0, "A");
 +</sxh>
 +The code generated passes the corresponding pointer of A is passed into the function call.
  
  
schedule_code_generator_for_code_with_subsystem.txt ยท Last modified: 2017/04/19 13:31 (external edit)