Jump to content

  • Log In with Google      Sign In   
  • Create Account

cg shader time measurement


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 sienaiwun   Members   -  Reputation: 128

Like
0Likes
Like

Posted 24 March 2012 - 10:12 AM

Hi all


I would like to know the exact time measurement for cg shader.


Now I have a display function containing two parts : cuda part computing data, and cg shader render the scene. Like the following :


Display()


{


time1 = time();


cudaEventRecord(record1);


RunCuda();


cudaEventRecord(record2);


time2 = time();


cgRender(); //in cgRender render the scene dozens of time.


time3 = time();


}


then define:


cudaTimebyTime = time2-time1;


cudaTimebyEvent = record2-record1;


cgTime = time3-time2;


then I find this:


cudaTimebyTime != cudaTimebyEvent , which means cudaEvent's time measurement is different from the time() function.


what's more, when I change cg function in cgRender(); (cudaTimebyTime - cudaTimebyTime) changes rather than the cgTime. It seems cgTime only records the scene drawing time while cg time measurement parts records in

(cudaTimebyTime - cudaTimebyTime).




Can it be true and what's the reason, how should I record the cg time measurement.



Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS