================
@@ -0,0 +1,81 @@
+// RUN: %libomptarget-compile-run-and-check-generic
+// This test checks that "update to" clause in OpenMP supports strided
sections.
+// #pragma omp target update to(result[0:8:2]) updates every other element
+// (stride 2)
+
+#include <omp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define N 16
+
+int main() {
+ double *result = (double *)calloc(N, sizeof(double));
+
+ // Initialize on host
+ for (int i = 0; i < N; i++) {
+ result[i] = i;
+ }
+
+ // Initial values
+ printf("original host array values:\n");
+ for (int i = 0; i < N; i++)
+ printf("%f\n", result[i]);
+ printf("\n");
+
+#pragma omp target data map(tofrom : result[0 : N])
+ {
+// Update strided elements to device: indices 0,2,4,6
+#pragma omp target update to(result[0 : 8 : 2])
----------------
amitamd7 wrote:
Fixed.
https://github.com/llvm/llvm-project/pull/157443
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits