record MultiDual {
type t;
type d;
var prim : t;
var dual : d;
}
proc gradient(x : [?D] ?t) {
type d = MultiDual(t, [D] t);
var x0 : [D] d;
forall i in D {
var eps : [D] t = 0.0;
eps[i] = 1.0;
x0[i] = new d(x[i], eps); // this is line 15
}
return x0;
}
var x = [1.0, 2.0, 3.0];
var a = gradient(x);
writeln(a);
produces
src/multidual.chpl:15: internal error: UTI-MIS-0935 chpl version 1.26.0
Note: This source location is a guess.
Internal errors indicate a bug in the Chapel compiler ("It's us, not you"),
and we're sorry for the hassle. We would appreciate your reporting this bug --
please see https://chapel-lang.org/bugs.html for instructions. In the meantime,
the filename + line number above may be useful in working around the issue.
Compile command:
chpl multidual.chpl
Associated Future Test(s):
Configuration Information
Output of chpl --version:
chpl version 1.26.0
built with LLVM version 12.0.0
Copyright 2020-2022 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
Output of $CHPL_HOME/util/printchplenv --anonymize:
Back-end compiler and version, e.g. gcc --version or clang --version:
gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.