PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Doubts about subarray copy to and from device

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
pedropaislopes



Joined: 26 Sep 2008
Posts: 2

PostPosted: Sun May 29, 2011 9:11 am    Post subject: Doubts about subarray copy to and from device Reply with quote

Hello.

I have the following Fortran code:

Code:

(...)
!$acc region copy(sh_c(:,iw0)),copyin(con_c(:,iw0)),copyout(cat_cx,cat_rx)

cat_rx%cat1 = 0.
cat_rx%cat2 = 0.
cat_rx%cat3 = 0.
cat_rx%cat4 = 0.
cat_rx%cat5 = 0.
cat_rx%cat6 = 0.
cat_rx%cat7 = 0.
cat_cx%cat1 = 0.
cat_cx%cat2 = 0.
cat_cx%cat3 = 0.
cat_cx%cat4 = 0.
cat_cx%cat5 = 0.
cat_cx%cat6 = 0.
cat_cx%cat7 = 0.

if (jnmb(1) >= 1) then
   do k = lpw0,mza0
      if (sh_c(k,iw0) >= rxmin(1)) then

         cat_rx(k)%cat1 = sh_c(k,iw0) * rhoa(k)

         if (jnmb(1) >= 5) cat_cx(k)%cat1 = con_c(k,iw0) * rhoa(k)

      elseif (sh_c(k,iw0) < 0.) then

         sh_c(k,iw0) = 0.

      endif
   enddo
endif
!$acc end region
(...)


This produce right results. Changing:

Code:

!$acc region copy(sh_c(:,iw0)),copyin(con_c(:,iw0)),copyout(cat_cx,cat_rx)


to:

Code:

!$acc region copy(sh_c(lpw0:mza0,iw0)),copyin(con_c(lpw0:mza0,iw0)),copyout(cat_cx,cat_rx)


produces wrong results, or even a segmentation fault.

The compiler shows a similar construction when the statement is:


Code:

!$acc region copyout(cat_cx,cat_rx)


Producing the following message:

Code:

mic_copy:
    937, Generating copyout(cat_rx(:))
         Generating copyout(cat_cx(:))
    938, Generating copyin(rhoa(lpw0:mza0))
         Generating copy(sh_c(lpw0:mza0,iw0))
         Generating copyin(rxmin(1))
         Generating copyin(con_c(lpw0:mza0,iw0))
         Generating copyin(jnmb(1))
         Generating compute capability 1.3 binary



The sh_c and con_c variables are coming from modules.

Is the accelerator copy task misaligned? How can I produce correct results copying just a part of the matrix?

Thanks a lot!
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6138
Location: The Portland Group Inc.

PostPosted: Tue May 31, 2011 9:38 am    Post subject: Reply with quote

Hi pedropaislopes,

Can you please post a reproducing example or send one to PGI Customer Service (trs@pgroup.com) and ask them to forward it to me?

Thanks,
Mat
Back to top
View user's profile
pedropaislopes



Joined: 26 Sep 2008
Posts: 2

PostPosted: Tue May 31, 2011 10:52 am    Post subject: Reply with quote

Mat, I will do that ASAP.

Thank you!
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group