chapel icon indicating copy to clipboard operation
chapel copied to clipboard

[Bug]: Incorrect result of loop expression that creates records on a GPU

Open DanilaFe opened this issue 9 months ago • 1 comments

Summary of Problem

Description: The following program:

record myRec {
    var x : int;
}

on here.gpus[0] {
    var Source = [1,2,3,4,5];
    writeln(Source);

    var SourceRec = [i in Source] new myRec(i);
    writeln(SourceRec);
}

Prints this outside on here.gpus[0]:

(x = 1) (x = 2) (x = 3) (x = 4) (x = 5)
6 7 8 9 10

This in here.gpus[0] with CPU-as-device:

(x = 1) (x = 2) (x = 3) (x = 4) (x = 5)
6 7 8 9 10

And this on an Nvidia GPU node:

(x = 1) (x = 1) (x = 1) (x = 1) (x = 1)
6 6 6 6 6

Is this a blocking issue with no known work-arounds? It just came up in a test, but it's a correctness issue.

DanilaFe avatar May 03 '24 18:05 DanilaFe