update test to show use_device_ptr(x) works on device
@@ -16,8 +16,9 @@ program test
x(i)=2
enddo
- !$omp target data is_device_ptr(x)
- write(*, *) "In tagret data=", x(1)
+ write(0, *) "before device_ptr ", x(1)
+ !$omp target data use_device_ptr(x)
+ write(0, *) "in device_ptr", x(1)
!$omp end target data
!$omp target
@@ -26,9 +27,22 @@ program test
endif
!$omp end target
- write(*, *) "Outside tagret data=", x(1)
+ !$omp target teams distribute parallel do
+ do i=1, 128
+ x(i)=3
+ enddo
+ !$omp end target teams distribute parallel do
+
+ !$omp target
+ if (omp_get_thread_num() .eq. 0) then
+ call f90printf("In tagret data 2=", x(1))
+ endif
+ !$omp end target
+
+ write(*, *) "Outside tagret data3=", x(1)
- !$omp target exit data map(release:x)
+ !$omp target exit data map(from:x)
+ write(*, *) "Outside tagret data4=", x(1)
nullify(x)
