PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Timing GPU Region

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



Joined: 23 Nov 2009
Posts: 35

PostPosted: Tue May 15, 2012 10:23 pm    Post subject: Timing GPU Region Reply with quote

Will the following be an accurate capture of the time spent on the GPU?

Code:

      CALL SYSTEM_CLOCK(ICOUNTIN,ICOUNT_RATE,ICOUNT_MAX)

!==
!==   A BUNCH OF KERNEL LAUNCHES
!==

      ISTAT=ISTAT+CUDADEVICESYNCHRONIZE()

      CALL SYSTEM_CLOCK(ICOUNTOUT,ICOUNT_RATE,ICOUNT_MAX)
      ITIME=ITIME+(ICOUNTOUT-ICOUNTIN)
      GPU_TIME_IN_SECONDS=DBLE(ITIME)/DBLE(ICOUNT_RATE)


If it is not then why wouldn't this work?
Back to top
View user's profile
mkcolg



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

PostPosted: Thu May 17, 2012 12:12 pm    Post subject: Reply with quote

Hi Sarom,

This code would give you the total time the host spends between the two system_clock calls. This will include both host and gpu execution time as well any data movement time. If you want just the GPU kernel times, then you need to use CUDA Events or profile the code.

- Mat
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