Add test for ompx_<ext> extensions for fast/unsafe/safe FP atomic hint values.
@@ -25,10 +25,64 @@ int main() {
sum+=1.0;
}
+ if (sum != (double) n) {
+ printf("Error with fast fp atomics, got %lf, expected %lf", sum, (double) n);
+ err = 1;
+ }
+
+ sum = 0.0;
+
+ #pragma omp target teams distribute parallel for map(tofrom:sum)
+ for(int i = 0; i < n; i++) {
+ #pragma omp atomic hint(AMD_unsafe_fp_atomics)
+ sum+=1.0;
+ }
+
if (sum != (double) n) {
printf("Error with unsafe fp atomics, got %lf, expected %lf", sum, (double) n);
err = 1;
}
+ sum = 0.0;
+
+ #pragma omp target teams distribute parallel for map(tofrom:sum)
+ for(int i = 0; i < n; i++) {
+ #pragma omp atomic hint(ompx_fast_fp_atomics)
+ sum+=1.0;
+ }
+
+ if (sum != (double) n) {
+ printf("Error with OMPX fast fp atomics, got %lf, expected %lf", sum, (double) n);
+ err = 1;
+ }
+
+ sum = 0.0;
+
+ #pragma omp target teams distribute parallel for map(tofrom:sum)
+ for(int i = 0; i < n; i++) {
+ #pragma omp atomic hint(ompx_unsafe_fp_atomics)
+ sum+=1.0;
+ }
+
+ if (sum != (double) n) {
+ printf("Error with OMPX unsafe fp atomics, got %lf, expected %lf", sum, (double) n);
+ err = 1;
+ }
+
+ sum = 0.0;
+
+ #pragma omp target teams distribute parallel for map(tofrom:sum)
+ for(int i = 0; i < n; i++) {
+ #pragma omp atomic hint(ompx_safe_fp_atomics)
+ sum+=1.0;
+ }
+
+ if (sum != (double) n) {
+ printf("Error with OMPX safe fp atomics, got %lf, expected %lf", sum, (double) n);
+ err = 1;
+ }
+
+
+
return err;
}
