mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-07 23:13:01 -06:00
[OpenCL] Fixes out of bounds read in reordering code in ILU0.
rowPerColor only has size numColors!
This commit is contained in:
parent
da40f0200e
commit
8d3eac81a5
@ -119,10 +119,9 @@ namespace bda
|
||||
queue->enqueueWriteBuffer(s.invDiagVals, CL_TRUE, 0, mat->Nb * sizeof(double) * bs * bs, invDiagVals);
|
||||
|
||||
int *rowsPerColorPrefix = new int[numColors + 1];
|
||||
int prefix = 0;
|
||||
for (int i = 0; i < numColors + 1; ++i) {
|
||||
rowsPerColorPrefix[i] = prefix;
|
||||
prefix += rowsPerColor[i];
|
||||
rowsPerColorPrefix[0] = 0;
|
||||
for (int i = 0; i < numColors; ++i) {
|
||||
rowsPerColorPrefix[i+1] =rowsPerColorPrefix[i] + rowsPerColor[i];
|
||||
}
|
||||
queue->enqueueWriteBuffer(s.rowsPerColor, CL_TRUE, 0, (numColors + 1) * sizeof(int), rowsPerColorPrefix);
|
||||
delete[] rowsPerColorPrefix;
|
||||
|
Loading…
Reference in New Issue
Block a user