====== Schedule Code Generator ======
Given an affine system and a target mapping, this page shows how to generate the scheduled code based on the given target mapping.
===== Usage =====
For the Alphabets program for matrix product.
affine matrix_product {P, Q, R|P>0 && Q>0 && R>0}
given float A {i,k| 0<=i
The following commands will generate the scheduled code based on the given target mapping.
# Load an alphabets program and store as 'program'
program = ReadAlphabets("../../alphabets/matrix_product.ab");
# Define a variable 'system' to store the system name
system = "matrix_product";
# Specify the output directory
outDir = "../../test-out/scheduleC/";
# Set the target mapping as described in the target mapping section[[Target Mapping]]
setSpaceTimeMap(program, system, "temp_C", "(i,j,k->i,j,k)");
setSpaceTimeMap(program, system, "C", "(i,j,k->i,j,k)");
# Set first and second dimension to be parallel (or generate sequential code by no parallel specification)
setParallel(program, system, "", "0,1");
# Set the statement ordering
setStatementOrdering(program, system, "temp_C", "C");
# Set the memory map
setMemoryMap(program, system, "temp_C", "inner_product", "(i,j,k->i,j)");
# Generate scheduled code according to the target mapping
generateScheduledCode(program, system, outDir);
# Generate the makefile
generateMakefile(program, system, outDir);
# Generate the wrapper to call the generated program
generateWrapper(program, system, outDir);
A Makefile, matrix_product.c and matrix_product-wrapper.c are generated for the above example.\\
Use the Makefile to compile the 'C' files.