Skip to content

Commit bdc2c80

Browse files
committed
Minor fix + formatting change for web tool
1 parent c7aa8ea commit bdc2c80

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

_includes/demo.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
<h6 style="margin-bottom: 0px; margin-top: 18px">Input a tensor algebra expression in index notation to generate code that computes it:</h6>
2929
<div class="input-bar">
3030
<div class="mdl-textfield mdl-js-textfield expr-input">
31-
<input id="txtExpr" class="mdl-textfield__input" value="y(i) = A(i,j) * x(j)" style="font-family: monospace" spellcheck="false" autocomplete="false" autocorrect="false" autocapitalize="false">
31+
<input id="txtExpr" class="mdl-textfield__input" value="y(i) = A(i,j) * x(j)" style="font-family: monospace" spellcheck="false" autocomplete="off" autocorrect="false" autocapitalize="false">
3232
<span id="lblError" class="mdl-textfield__error" style="font-size: 14px"></span>
33+
<label class="mdl-textfield__label"></label>
3334
</div>
3435
<div class="input-bar-misc">
3536
<div style="float: left; margin-top: 16px">
@@ -171,10 +172,10 @@ <h6 style="margin-bottom: 0px; margin-top: 18px">Input a tensor algebra expressi
171172
</tr>
172173
</table>
173174
<div class="mdl-tabs__panel is-active" id="compute-panel">
174-
<pre style="margin: 0px 0px; padding: 0px 0px"><code id="txtComputeLoops" class="lang-cpp">/* The generated compute loops will appear here */</code></pre>
175+
<pre style="margin: 0px 0px; padding: 0px 0px"><code id="txtComputeLoops" class="lang-cpp">/* The generated compute code will appear here */</code></pre>
175176
</div>
176177
<div class="mdl-tabs__panel" id="assembly-panel">
177-
<pre style="margin: 0px 0px; padding: 0px 0px"><code id="txtAssemblyLoops" class="lang-cpp">/* The generated assemble loops will appear here */</code></pre>
178+
<pre style="margin: 0px 0px; padding: 0px 0px"><code id="txtAssemblyLoops" class="lang-cpp">/* The generated assemble code will appear here */</code></pre>
178179
</div>
179180
<div class="mdl-tabs__panel" id="full-panel">
180181
<pre style="margin: 0px 0px; padding: 0px 0px"><code id="txtFullCode" class="lang-cpp">/* The complete generated code will appear here */</code></pre>

javascripts/demo.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ function demo() {
553553

554554
for (t in model.input.tensorOrders) {
555555
if (model.input.tensorOrders[t] > 0) {
556-
tblFormatsView.insertNamesCacheEntry(t, $("#format" + t).val());
556+
tblFormatsView.insertNamesCacheEntry(t, $("#format" + t).html());
557557
tblFormatsView.insertLevelsCacheEntry(t,
558558
tblFormatsView.createEntryFromId("dims" + t));
559559
}
@@ -612,55 +612,55 @@ function demo() {
612612

613613
var scheduleCommands = {
614614
pos: {
615-
parameters: ["Original IndexVar", "Derived IndexVar", "Accessed Tensor"],
615+
parameters: ["Original Index Variable", "Derived Index Variable", "Accessed Tensor"],
616616
0: ["index dropdown", [1, "pos"]],
617617
1: ["default", ""],
618618
2: ["access dropdown"]
619619
},
620620
fuse: {
621-
parameters: ["Outer IndexVar", "Inner IndexVar", "Fused IndexVar"],
621+
parameters: ["Outer Index Variable", "Inner Index Variable", "Fused Index Variable"],
622622
0: ["index dropdown"],
623623
1: ["index dropdown"],
624624
2: ["default", "f"]
625625
},
626626
split: {
627-
parameters: ["Split IndexVar", "Outer IndexVar", "Inner IndexVar", "Split Factor"],
627+
parameters: ["Split Index Variable", "Outer Index Variable", "Inner Index Variable", "Split Factor"],
628628
0: ["index dropdown", [1, "0"], [2, "1"]],
629629
1: ["default", ""],
630630
2: ["default", ""],
631631
3: ["text"]
632632
},
633633
divide: {
634-
parameters: ["Divided IndexVar", "Outer IndexVar", "Inner IndexVar", "Divide Factor"],
634+
parameters: ["Divided Index Variable", "Outer Index Variable", "Inner Index Variable", "Divide Factor"],
635635
0: ["index dropdown", [1, "0"], [2, "1"]],
636636
1: ["default", ""],
637637
2: ["default", ""],
638638
3: ["text"]
639639
},
640640
precompute: {
641-
parameters: ["Precomputed Expr", "Original IndexVar", "Workspace IndexVar"],
641+
parameters: ["Precomputed Expression", "Original Index Variable", "Workspace Index Variable"],
642642
0: ["long text"],
643643
1: ["index dropdown", [2, ""]],
644644
2: ["default", ""]
645645
},
646646
reorder: {
647-
parameters: ["Reordered IndexVar"],
647+
parameters: ["Index Variable"],
648648
0: ["index dropdown"]
649649
},
650650
bound: {
651-
parameters: ["Original IndexVar", "Bounded IndexVar", "Bound", "Bound Type"],
651+
parameters: ["Original Index Variable", "Bounded Index Variable", "Bound", "Bound Type"],
652652
0: ["index dropdown", [1, "bound"]],
653653
1: ["default", ""],
654654
2: ["text"],
655655
3: ["predefined dropdown", "Max Exact", "Min Exact", "Min Constraint", "Max Exact", "Max Constraint"]
656656
},
657657
unroll: {
658-
parameters: ["Unrolled IndexVar", "Unroll Factor"],
658+
parameters: ["Unrolled Index Variable", "Unroll Factor"],
659659
0: ["index dropdown"],
660660
1: ["text"]
661661
},
662662
parallelize: {
663-
parameters: ["Parallel IndexVar", "Hardware", "Race Strategy"],
663+
parameters: ["Parallelized Index Variable", "Hardware", "Race Strategy"],
664664
0: ["index dropdown"],
665665
1: ["predefined dropdown", "CPU Thread",
666666
"Not Parallel", "CPU Thread", "CPU Vector",
@@ -791,6 +791,10 @@ function demo() {
791791
var inputId = "param" + row + "-" + p;
792792
var input = model.getScheduleParameter(row, p);
793793

794+
if (command === "reorder") {
795+
parameterName += " 1";
796+
}
797+
794798
var parameterInfo = commandInfo[p];
795799
switch (parameterInfo[0]) {
796800
case "index dropdown":
@@ -819,7 +823,7 @@ function demo() {
819823

820824
if (command === "reorder") {
821825
for (var p = 1; p < model.schedule[row].parameters.length; ++p) {
822-
var parameterName = parametersList[0];
826+
var parameterName = parametersList[0] + " " + (p + 1);
823827
var inputId = "param" + row + "-" + p;
824828
var input = model.getScheduleParameter(row, p);
825829

@@ -1019,10 +1023,10 @@ function demo() {
10191023
var panelKernelsView = {
10201024
updateView: function(timeout) {
10211025
var computeLoops = (model.output.computeLoops === "") ?
1022-
"/* The generated compute loops will appear here */" :
1026+
"/* The generated compute code will appear here */" :
10231027
model.output.computeLoops.replace(/</g, "&lt;");
10241028
var assemblyLoops = (model.output.assemblyLoops === "") ?
1025-
"/* The generated assemble loops will appear here */" :
1029+
"/* The generated assemble code will appear here */" :
10261030
model.output.assemblyLoops.replace(/</g, "&lt;");
10271031
var fullCode = (model.output.fullCode === "") ?
10281032
"/* The complete generated code will appear here */" :

0 commit comments

Comments
 (0)