Skip to content

Commit

Permalink
Update tmacd-promotion
Browse files Browse the repository at this point in the history
One of the cases stopped printing out a rank change array
(due to the resolution of issue #16275).

See issue #16300 which asks questions about the current output.
  • Loading branch information
mppf committed Aug 26, 2020
1 parent 7b179a4 commit 83307b4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 13 deletions.
1 change: 1 addition & 0 deletions modules/internal/ChapelArray.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -5068,6 +5068,7 @@ module ChapelArray {
// instances
// TODO: can we make this domain constant by passing an argument to the
// initializer?
// MPPF: Should this shape be un-view'd?
var shape = new _domain(ir._shape_);

// Important: ir._shape_ points to a domain class for a domain
Expand Down
54 changes: 45 additions & 9 deletions test/arrays/shapes/tmacd-promotion.chpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
config const n = 2;
var b: [0..n+1, 0..n+1, 0..1] int;

const N = b[0..n-1, 0..n-1, 0];
writeln("====== N ======");
writeln(N);
writeln(N.type:string);

const NN = b[0..n-1, 0..n-1, 0] + b[0..n-1, 2..n+1, 0];
writeln("====== NN =====");
writeln(NN);
writeln(NN.type:string);
proc initb() {
for i in 0..n+1 {
for j in 0..n+1 {
for k in 0..1 {
b[i,j,k] = 10000*i + 100*j + k;
}
}
}
}

{
initb();
const N = b[0..n-1, 0..n-1, 0];
b = 0;
writeln("====== const N ======");
writeln(N);
writeln(N.type:string);
}

{
initb();
const NN = b[0..n-1, 0..n-1, 0] + b[0..n-1, 2..n+1, 0];
b = 0;
writeln("====== const NN =====");
writeln(NN);
writeln(NN.type:string);
}

{
initb();
const ref N = b[0..n-1, 0..n-1, 0];
b = 0;
writeln("====== const ref N ======");
writeln(N);
writeln(N.type:string);
}

{
initb();
const ref NN = b[0..n-1, 0..n-1, 0] + b[0..n-1, 2..n+1, 0];
b = 0;
writeln("====== const ref NN =====");
writeln(NN);
writeln(NN.type:string);
}
15 changes: 11 additions & 4 deletions test/arrays/shapes/tmacd-promotion.good
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
====== N ======
0 0
0 0
====== const N ======
0 100
10000 10100
[domain(2,int(64),false)] int(64)
====== const NN =====
200 400
20200 20400
[ArrayViewRankChangeDom(2,int(64),false,3*bool,3*int(64),int(64),unmanaged ArrayViewRankChangeDist(unmanaged DefaultDist,3*bool,3*int(64)))] int(64)
====== NN =====
====== const ref N ======
0 0
0 0
[ArrayViewRankChangeDom(2,int(64),false,3*bool,3*int(64),int(64),unmanaged ArrayViewRankChangeDist(unmanaged DefaultDist,3*bool,3*int(64)))] int(64)
====== const ref NN =====
0 0 0 0
iterator

0 comments on commit 83307b4

Please sign in to comment.