Skip to content

Commit d29aebc

Browse files
chandraghaleChandra Ghale
authored andcommitted
LLVM Buildbot failure on openmp runtime test (llvm#143674)
Error looks to be missing includes for complex number support in some system. Removing test for now. Relevant PR : [PR-134709](llvm#134709) ``` .---command stderr------------ # | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:78:42: error: use of undeclared identifier 'I' # | 78 | double _Complex expected = 0.0 + 0.0 * I; # | | ^ # | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:79:40: error: use of undeclared identifier 'I' # | 79 | double _Complex result = 0.0 + 0.0 * I; # | | ^ # | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:84:22: error: use of undeclared identifier 'I' # | 84 | arr[i] = i - i * I; # | | ^ # | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:92:19: error: use of undeclared identifier 'creal' # | 92 | real_sum += creal(arr[i]); # | | ^~~~~ # | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:93:19: error: use of undeclared identifier 'cimag' # | 93 | imag_sum += cimag(arr[i]); # | | ^~~~~ # | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:96:36: error: use of undeclared identifier 'I' # | 96 | result = real_sum + imag_sum * I; # | | ^ # | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:97:9: error: use of undeclared identifier 'cabs' # | 97 | if (cabs(result - expected) > 1e-6) { # | | ^~~~ # | 7 errors generated. ``` Co-authored-by: Chandra Ghale <[email protected]>
1 parent bba4a20 commit d29aebc

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -73,34 +73,6 @@ void performMinMaxRed(int &min_val, int &max_val) {
7373
max_val = input_data[i];
7474
}
7575
}
76-
int performComplexReduction() {
77-
double _Complex arr[N];
78-
double _Complex expected = 0.0 + 0.0 * I;
79-
double _Complex result = 0.0 + 0.0 * I;
80-
int error = 0;
81-
82-
// Initialize the array and compute serial sum
83-
for (int i = 0; i < N; ++i) {
84-
arr[i] = i - i * I;
85-
expected += arr[i];
86-
}
87-
double real_sum = 0.0, imag_sum = 0.0;
88-
#pragma omp parallel private(real_sum) private(imag_sum)
89-
{
90-
#pragma omp for reduction(+ : real_sum, imag_sum)
91-
for (int i = 0; i < N; ++i) {
92-
real_sum += creal(arr[i]);
93-
imag_sum += cimag(arr[i]);
94-
}
95-
96-
result = real_sum + imag_sum * I;
97-
if (cabs(result - expected) > 1e-6) {
98-
error++;
99-
}
100-
}
101-
return error;
102-
}
103-
10476
std::complex<double> doComplexReduction(std::complex<double> *arr) {
10577
std::complex<double> result(1, 0);
10678

@@ -138,7 +110,8 @@ int main(void) {
138110
const float kPiVal = 3.14f;
139111
const int kExpectedSum = 45; // Sum of 0..9
140112
const int kExpectedProd = 3628800; // 10!
141-
const float kExpectedFsum = kPiVal * N; // 3.14f * 10
113+
const float kExpectedFsum = 31.400000f; // 3.14f * 10
114+
const float kTolerance = 1e-4f;
142115
const int kExpectedMin = 3;
143116
const int kExpectedMax = 12;
144117
std::complex<double> arr[N];
@@ -163,7 +136,7 @@ int main(void) {
163136
total_errors++;
164137
if (t_prod_v != kExpectedProd)
165138
total_errors++;
166-
if (t_fsum_v != kExpectedFsum)
139+
if (std::abs(t_fsum_v - kExpectedFsum) > kTolerance)
167140
total_errors++;
168141
}
169142
#pragma omp parallel num_threads(4)
@@ -177,7 +150,6 @@ int main(void) {
177150
total_errors++;
178151
}
179152
total_errors += checkUserDefinedReduction();
180-
total_errors += performComplexReduction();
181153
#pragma omp parallel num_threads(4)
182154
{
183155
std::complex<double> result(1, 0);

0 commit comments

Comments
 (0)