tldm_app tiled_cholesky;
// iterator variables
tldm_data iterator_i (“i”); // scalar variable
tldm_data iterator_j (“j”);
tldm_data iterator_k (“k”);
// environment parameters
tldm_data param_p (“p”);
// array A [ p ] [ p ] [ i + 1 ]
tldm_data array_A(“A”, 3); // n_dimension = 3
array_A.insert_index_constraint(0, “ > = ”, 0);
array_A.insert_index_constraint(0, “<”, p);
array_A.insert_index_constraint(1, “ > = ”, 0);
array_A.insert_index_constraint(1, “<”, p);
array_A.insert_index_constraint(2, “ > = ”, 0);
array_A.insert_index_constraint(2, “<”, p+1);
// attach data into tldm application
tiled_cholesky.attach_data(&iterator_i);
tiled_cholesky.attach_data(&iterator_j);
titled_cholesky.attach_data(&iterator_k);
tiled_cholesky.attach_data(&param_p);
tiled_cholesky.attach_data(&array_A);
// iteration domain of task seq_cholesky
tldm_iteration_domain id_k;
id_k.insert_iterator(iterator_k); // “k”
id_k.insert_affine_constraint(“k”, 1, “>=”, 0); // k*1 >= 0
id_k.insert_affine_constraint(“k”, -1, “p”, 1, “>”, 0); // -k+p > 0
// accesses A [ k ] [ k ] [k+1 ]
tldm_access acc_A0 (&array_A, WRITE);
acc_A0.insert_affine_constraint(“A(0)”, 1, “k”, -1, “=”, 0); // A0 = k
acc_A0.insert_affine_constraint(“A(1)”, 1, “k”, -1, “=”, 0); // A1 = k
acc_A0.insert_affine_constraint(“A(2)”, 1, “k”, -1, “=”, 1); // A2 = k+1
// accesses A [ k ] [ k ] [ k ]
tldm_access acc_A1 (&array_A, READ);
acc_A1.insert_affine_constraint(“A(0)”, 1, “k”, -1, “=”, 0);
acc_A1.insert_affine_constraint(“A(1)”, 1, “k”, -1, “=”, 0);
acc_A1.insert_affine_constraint(“A(2)”, 1, “k”, -1, “=”, 0);
// task seqCholesky
tldm_task seq_cholesky(“seqCholesky”);
seq_ cholesky.attach_id(&id_k);
seq_cholesky.attach_access(&acc_A0);
seq_cholesky.attach_access(&acc_A1);
seq_cholesky.attach_parent(NULL);
tiled_cholesky.attach_task(&seg_cholesky);
// iteration domain of task tri_solve
tldm_iteration_domain id_kj = id_k.copy(); // 0 <= k < p
id_kj.insert_iterator(iterator_j); // “j”
id_kj.insert_affine_constraint(“j”, 1, “k”, -1, “>=”, 1); // j-k >= 1
id_kj.insert_affine_constraint(“j”, -1, “p”, 1, “>”, 0); // -j+p > 0
// accesses A [ j ] [ k ] [ k + 1 ]
tldm_access acc_A2 = acc_A0.copy();
acc_A2.replace_affine_constraint(“A(0)”, 1, “j”, -1, “=”, 0); // A0 = j
// accesses A [ j ] [ k ] [ k ]
tldm_access acc_A3 = acc_A1.copy();
acc_A3.replace_affine_constraint(“A(0)”, 1, “j”, -1, “=”, 0); // A0 = j
// accesses A [ k ] [ k ] [ k + 1 ]
tldm_access acc_A4 = acc_A1.copy();
acc_A4.replace_affine_constraint(“A(2)”, 1, “k”, -1, “=”, 1); // A2 = k+1
// task TriSolve
tldm_task tri_solve(“TriSolve”);
tri_solve.attach_id(&id_kj);
tri_solve.attach_access(&acc_A2);
tri_solve.attach_access(&acc_A3);
tri_solve.attach_access(&acc_A4);
tri_solve.attach_parent(NULL);
tiled_cholesky.attach_task(&tri_solve);
// iteration domain of task update
tldm_iteration_domain id_kji = id_kj.copy();
id_kji.insert_iterator(iterator_i); // “i”
id_kji.insert_affine_constraint(“i”, 1, “k”, -1, “>=”, 1); // i-k >= 1
id_ kji.insert_affine_constraint(“i”, -1, “j”, 1, “>=”, 0); // -i+j >= 0
// accesses A [ j ] [ i ] [ k + 1 ]
tldm_access acc_A5 = acc_A2.copy();
acc_A5.replace_affine_constraint(“A(1)”, 1, “i”, -1, “=”, 0); // A1 = i
// accesses A [ j ] [ k ] [ k + 1 ]
tldm_access acc_A6 = acc_A4.copy();
acc_A6.replace_affine_constraint(“A(0)”, 1, “j”, -1, “=”, 0); // A0 = j
// accesses A [ i ] [ k ] [ k + 1 ]
tldm_access acc_A7 = acc_A4.copy();
acc_A7.replace_affine_constraint(“A(0)”, 1, “i”, -1, “=”, 1); // A0 = i
// task Update
tldm_task update (“Update”);
update.attach_id(&id_kji);
update.attach_access(&acc_A5);
update.attach_access(&acc_A6);
update.attach_access(&acc_A7);
update.attach_parent(NULL);
tiled_cholesky.attach_task(&update);
// dependence: TriSolve<k,j> -> Update<k,j, >
tldm_dependence dept(&tri_solve, &update);
dept.insert_affine_constraint(“k”, 1, 0, “->”, “k”, 1, 0); // k0=k1
dept.insert_affine_constraint(“j”, 1, 0, “->”, “j”, 1, 0); // j0=j1
Listing 14: C++ TLDM specification of tiled Cholesky.