PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

cudaMemcpy into part of an array?

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



Joined: 06 Jul 2009
Posts: 306
Location: Greenbelt, MD

PostPosted: Thu Jun 21, 2012 5:54 am    Post subject: cudaMemcpy into part of an array? Reply with quote

I was wondering if it's possible to do something like the following:
Code:
STATUS = cudaMemcpy(ArgVar2d(:,:,3),QSS,IM*JM* LM   )
where QSS, say, is shape (IM,JM,LM) and ArgVar2d is a device array of shape(IM*JM,LM,5).

I often reshape arrays via the cudaMemcpy interface when one is IM,JM,LM and the other is IM*JM,LM, but I've never tried to "insert" into the device array like this.

Matt
Back to top
View user's profile
TheMatt



Joined: 06 Jul 2009
Posts: 306
Location: Greenbelt, MD

PostPosted: Thu Jun 21, 2012 12:56 pm    Post subject: Reply with quote

Answering my own question (with guidance from more knowledgeable people than I), the thing to do is think like the old days of F77:
Code:
STATUS = cudaMemcpy(ArgVar2d(1,1,3),QSS,IM*JM* LM   )

Assumed-size-like or C-like in thinking seems to work.
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