You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unifiy storage order of RefArray, ticket:4093, ticket:4072
Assigning between RefArray and value Array copies storage linearly.
This is why RefArray must have column-major storage layout as well.
The bug doesn't seem to show up because generated code currently
instantiates an intermediate array element by element, e.g. if a
RefArray is passed to a function. This could and should be optimized.
//print("SimCodeUtil.getVarIndexInfosByMapping: Found variable index for '" + ComponentReference.printComponentRefStr(iVarName) + "'. The value is " + intString(concreteVarIndex) + "\n");
10967
10967
for arrayIdx in 0:(arraySize-1) loop
10968
-
idx := arrayGet(varIndices, arraySize-arrayIdx);
10968
+
idx := arraySize-arrayIdx;
10969
+
if iColumnMajor then
10970
+
// convert to row major so that column major access will give this idx
//print("SimCodeUtil.tmpVarIndexListNew: Warning, negativ aliases (" + ComponentReference.printComponentRefStr(iVarName) + ") are not supported at the moment!\n");
@@ -10977,11 +10982,12 @@ algorithm
10977
10982
end if;
10978
10983
end if;
10979
10984
end for;
10980
-
if (not isVarIndexListConsecutive(iVarToArrayIndexMapping,iVarName) and iColumnMajor) then
10985
+
if isVarIndexListConsecutive(iVarToArrayIndexMapping,iVarName) and iColumnMajor then
10981
10986
//if the array is not completely stuffed (e.g. some array variables have been derived and became dummy-derivatives), the array will not be initialized as a consecutive array, therefore we cannot take the colMajor-indexes
0 commit comments