Skip to content

Commit

Permalink
Fix reductions ctest for nvidia on perlmutter
Browse files Browse the repository at this point in the history
Release build with -O2 incorrectly optimized out inner-loop if-stmt.
This re-orders for-loops to avoid that.
  • Loading branch information
amametjanov committed Dec 11, 2024
1 parent 18de8ef commit cb5b7a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/omega/test/base/ReductionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ int main(int argc, char *argv[]) {
// test MIN, MAX of arrays
HostArray1DI4 HostA1DI4Work("HostA1DI4Work", NumCells * MySize);
HostArray1DI4 HostA1DI4Min("HostA1DI4Min", NumCells * MySize);
for (i = 0; i < MySize; i++) {
for (j = 0; j < NumCells; j++) {
for (j = 0; j < NumCells; j++) {
for (i = 0; i < MySize; i++) {
k = i * NumCells + j;
if (MyTask == i) {
HostA1DI4Work(k) = (i + 1) * k; // processor-specific work array
Expand Down

0 comments on commit cb5b7a9

Please sign in to comment.