Skip to content

Commit 4f78112

Browse files
author
Jessica Shi
committed
work in progress updates
1 parent be57949 commit 4f78112

File tree

4 files changed

+87
-17
lines changed

4 files changed

+87
-17
lines changed

documentation/docs/scheduling.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ for (int32_t i = 0; i < A1_dimension; i++) {
4646
}
4747
```
4848

49+
# Fuse
50+
51+
The `fuse(i, j, f)` transformation takes in two index variables `i` and `j`, where `j` is directly nested under `i`, and collapses them into a fused index variable `f` that iterates over the product of the coordinates `i` and `j`.
52+
53+
For the SpMV example, we could have:
54+
```c++
55+
stmt = stmt.fuse(i, j, IndexVar("f"));
56+
```
57+
4958
# Split
5059

5160
The `split(i, i0, i1, splitFactor)` transformation splits (strip-mines) an index variable `i` into two nested index variables `i0` and `i1`. The size of the inner index variable `i1` is then held constant at `splitFactor`, which must be a positive integer.
@@ -69,6 +78,10 @@ for (int32_t i0 = 0; i0 < ((A1_dimension + 15) / 16); i0++) {
6978
}
7079
```
7180

81+
# Divide
82+
83+
# Precompute
84+
7285
# Reorder
7386

7487
The `reorder(vars)` transformation takes in a new ordering for a set of index variables in the expression that are directly nested in the iteration order.
@@ -86,5 +99,13 @@ for (int32_t jA = A2_pos[iA]; jA < A2_pos[(iA + 1)]; jA++) {
8699
}
87100
```
88101

102+
# Bound
103+
104+
# Unroll
105+
106+
# Parallelize
107+
108+
109+
89110

90111

javascripts/demo.js

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,14 @@ function demo() {
615615
parallelize: {
616616
parameters: ["Parallel IndexVar", "Hardware", "Race Strategy"],
617617
0: ["index dropdown"],
618-
1: ["predefined dropdown", "CPU Thread", "Not Parallel", "Default Unit", "CPU Thread", "CPU Vector"],
619-
2: ["predefined dropdown", "No Races", "Ignore Races", "No Races", "Atomics", "Temporary", "Parallel Reduction"]
618+
1: ["predefined multi-dropdown", "CPU Thread",
619+
{"Not Parallel": [],
620+
"Default Unit": [],
621+
"CPU": ["CPU Thread", "CPU Vector", "CPU Thread Group Reduction"],
622+
"GPU": ["GPU Block", "GPU Thread", "GPU Block Reduction", "GPU Warp Reduction"]
623+
}],
624+
2: ["predefined dropdown", "No Races",
625+
"Ignore Races", "No Races", "Atomics", "Temporary", "Parallel Reduction"]
620626
}
621627
};
622628

@@ -626,9 +632,9 @@ function demo() {
626632
function empty(parameterName, inputId, input, long = false) {
627633
var parameter = "<li>"
628634
parameter += "<div class=\"schedule-input mdl-textfield mdl-js-textfield ";
629-
parameter += "mdl-textfield--floating-label getmdl-select has-placeholder ";
630-
parameter += long ? "schedule-input-long" : "";
631-
parameter += "\"><input class=\"space-font mdl-textfield__input\""
635+
parameter += "mdl-textfield--floating-label getmdl-select has-placeholder\" ";
636+
parameter += long ? "style=\"width:200px\"" : "";
637+
parameter += "><input class=\"space-font mdl-textfield__input\""
632638
parameter += "type=\"text\" autocomplete=\"off\" placeholder=\"\" value = \"";
633639
parameter += input;
634640
parameter += "\" id=\"";
@@ -640,11 +646,12 @@ function demo() {
640646
return parameter
641647
}
642648

643-
function dropdown(paramterName, inputId, input, defaultValue = "", useMonospace = true) {
649+
function dropdown(paramterName, inputId, input, defaultValue = "", useMonospace = true, length = "120px") {
644650
var parameter = "<li>";
645651
parameter += "<div class=\"schedule-input dropdown mdl-textfield mdl-js-textfield ";
646-
parameter += "mdl-textfield--floating-label getmdl-select has-placeholder\">";
647-
parameter += "<input class=\"mdl-textfield__input ";
652+
parameter += "mdl-textfield--floating-label getmdl-select has-placeholder\" ";
653+
parameter += "style=\"width:" + length + "\"";
654+
parameter += "><input class=\"mdl-textfield__input ";
648655
if (useMonospace) {
649656
parameter += "space-font";
650657
}
@@ -696,16 +703,47 @@ function demo() {
696703

697704
// a dropdown where user can choose from a set of predefined options
698705
function predefinedDropdown(parameterName, inputId, input, options) {
699-
var parameter = dropdown(parameterName, inputId, input, options[0], false);
706+
var parameter = dropdown(parameterName, inputId, input, options[0], false, "160px");
700707
for (var option of options.slice(1)) {
701-
parameter += "<li><a>";
708+
parameter += "<li style=\"width:160px\"><a>";
702709
parameter += option;
703710
parameter += "</a></li>";
704711
}
705712
parameter += "</ul></div></li>";
706713
return parameter;
707714
}
708715

716+
function predefinedMultiDropdown(parameterName, inputId, input, info) {
717+
var parameter = dropdown(parameterName, inputId, input, info[0], false, "245px");
718+
719+
options = info[1];
720+
for (var option in options) {
721+
if (options[option].length > 0) {
722+
parameter += "<li style=\"width:245px\" ";
723+
parameter += "class=\"dropdown-submenu ";
724+
parameter += option;
725+
parameter += "\"><a>" + option;
726+
parameter += "<i class=\"material-icons\" style=\"float:right\">";
727+
parameter += "keyboard_arrow_right</i></a>";
728+
parameter += "<ul class=\"options dropdown-menu\" for=\"";
729+
parameter += inputId;
730+
parameter += "\">";
731+
for (suboption of options[option]) {
732+
parameter += "<li style=\"width:245px\">";
733+
parameter += "<a>" + suboption + "</a></li>";
734+
}
735+
parameter += "</ul></li>";
736+
} else {
737+
parameter += "<li style=\"width:245px\"><a>";
738+
parameter += option;
739+
parameter += "</a></li>";
740+
}
741+
}
742+
parameter += "</ul></div></li>";
743+
return parameter;
744+
}
745+
746+
709747
var commandInfo = scheduleCommands[command];
710748
var parametersList = commandInfo["parameters"];
711749

@@ -726,6 +764,9 @@ function demo() {
726764
case "predefined dropdown":
727765
parameters += predefinedDropdown(parameterName, inputId, input, parameterInfo.slice(1));
728766
break;
767+
case "predefined multi-dropdown":
768+
parameters += predefinedMultiDropdown(parameterName, inputId, input, parameterInfo.slice(1));
769+
break;
729770
case "default":
730771
parameters += empty(parameterName, inputId, input);
731772
break;
@@ -860,6 +901,18 @@ function demo() {
860901
model.addReorderedVar(row);
861902
});
862903
});
904+
905+
$('.dropdown-submenu a').on("mouseover", function(e){
906+
$(this).next('ul').show();
907+
});
908+
909+
// hardcoded currently?
910+
$('.CPU').on("mouseleave", function(e){
911+
$(this).find('ul').hide();
912+
});
913+
$('.GPU').on("mouseleave", function(e){
914+
$(this).find('ul').hide();
915+
});
863916
}
864917
};
865918

stylesheets/dropdown.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
}
77

88
.formats li {
9-
width: 155px;
9+
width: 160px;
1010
}
1111

1212
.level-formats {
1313
padding-top: 0px;
1414
}
1515

1616
.level-formats li {
17-
width: 155px;
17+
width: 160px;
1818
}
1919

2020
.dropdown li {

stylesheets/style.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ ul {
141141

142142
.sortable li {
143143
float: left;
144-
width: 155px;
144+
width: 160px;
145145
padding: 0.5em;
146146
padding-top: 0px;
147147
padding-bottom: 0px;
@@ -221,10 +221,6 @@ ul {
221221
width: 120px;
222222
}
223223

224-
.schedule-input-long {
225-
width: 200px;
226-
}
227-
228224
.schedule-list {
229225
margin: 0px;
230226
padding: 0px;

0 commit comments

Comments
 (0)