do concurrent in pure subroutine

do concurrent in pure subroutine

When I try to compile the following program with ifort 12.1.3 20120212, I get

test_concurrent.f90(25): error #7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure. [I]
do concurrent(i=1:n)
------------------^
test_concurrent.f90(26): error #7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure. [PROD]
prod%d(i) = x%d(i)*y%d(i)
-------^
compilation aborted for test.f90 (code 1)

I can't see what I'm doing wrong, thanks for any suggestion!
Loris

module test_type implicit none type :: t1 real ,allocatable :: d(:) end type t1 interface operator(*) module procedure t1_times_t1 end interface private t1_times_t1 contains elemental function t1_times_t1(x,y) result(prod) type(t1) ,intent(in) :: x,y type(t1) :: prod integer :: i,n n = size(x%d) allocate(prod%d(n)) do concurrent(i=1:n) prod%d(i) = x%d(i)*y%d(i) end do end function t1_times_t1 end module test_type program test use test_type implicit none integer ,parameter :: ns = 16, np = 12*ns**2 type(t1) :: x,y,z allocate(x%d(np),y%d(np)) x%d = 2. y%d = 0.5 z = x*y print*,sum(z%d)/np end program test 

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Ronald W Green (Intel)

This appears to be a bug in the compiler. I have entered a bug report, the tracking ID is DPD200233820

thank you for sending this to us.

ron

Bild des Benutzers Ronald W Green (Intel)

This bug will have a fix in an upcoming update release, Composer XE 2013 Update 1. This should be available sometime in the next month.

Thank you for helping us improve our compiler.

ron

Melden Sie sich an, um einen Kommentar zu hinterlassen.