PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

timing a kernel in CUDA Dortran

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



Joined: 11 Jun 2009
Posts: 233

PostPosted: Wed Oct 13, 2010 12:19 pm    Post subject: timing a kernel in CUDA Dortran Reply with quote

Doe PGI Fortran implement a built-in timing like cutStartTimer() in CUDA C?
Or is there a way to test the runtime of a kernel, not using the profiler.

Thanks,
Tuan
Back to top
View user's profile
brentl



Joined: 20 Jul 2004
Posts: 132

PostPosted: Wed Oct 13, 2010 2:03 pm    Post subject: Reply with quote

Probably the most dependable timing mechanism is to use cuda Events.

istat = cudaEventCreate(startEvent)
istat = cudaEventCreate(stopEvent)

istat = cudaEventRecord(startEvent, 0)

! Do whatever you want to time here

istat = cudaEventRecord(stopEvent, 0)
istat = cudaEventSynchronize(stopEvent) ! or cudaThreadSynchronize()

istat = cudaEventElapsedTime(time, startEvent, stopEvent)
Back to top
View user's profile
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Thu Oct 14, 2010 12:35 pm    Post subject: Reply with quote

Thanks, Brentl. This is exactly what I want.

Tuan
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