PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

usage of acc_set_device & acc_init
Goto page Previous  1, 2
 
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: Mon Apr 05, 2010 5:54 am    Post subject: Reply with quote

mkcolg wrote:
Quote:
Looks like this is still the case at times.
Nothing's changed here. Though we did add an external utility "pgcudainit" which holds the device open and eliminates the initialization cost.

Hmm. I might have encountered something with this. I found that I have to call cudaThreadExit() before setting a device sometimes. If I don't, it says there is a context already running or something. Maybe due to the "pre-initialization" routine?
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Apr 05, 2010 1:14 pm    Post subject: Reply with quote

Hi Matt,

"acc_init" is for the PGI Accelerator model while cudaThreadExit if for CUDA Fortran so I'm not sure how mixing the two effects things. We starting work on allowing the two models to be mixed so please feel free to send me an example of the behavior you're seeing.

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



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

PostPosted: Tue Apr 06, 2010 10:16 am    Post subject: Reply with quote

mkcolg wrote:
Hi Matt,

"acc_init" is for the PGI Accelerator model while cudaThreadExit if for CUDA Fortran so I'm not sure how mixing the two effects things. We starting work on allowing the two models to be mixed so please feel free to send me an example of the behavior you're seeing.

Oh, no, I'm not mixing them. I was reacting to your comment about "...holds the device open and eliminates the initialization cost". I wondered if I was seeing something like that when I had to cudaThreadExit() before cudaSetDevice'ing. That is, some initialization routine higher than my code had established a context upon, say, "use cudafor" that I had to exit before setting the device.
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
Goto page Previous  1, 2
Page 2 of 2

 
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