We are currently programming using CUDA.
Therefore, I would like to measure the processing time on the CPU side accurately (milliseconds or microseconds).
There are functions for measuring time, but which one should I use after all?
"It depends on how you interpret the wording ""processing time""
"1. Time elapsed from job start to end (CPU may be playing during that time)
The QueryPerformanceCounter
should not be troublesome.
GetTickCount
also returns this value.
2. Time the CPU is actually running from the start to the end of the job
cuda consists of three main steps:
- Host Memory ->Data Transfer Time to GPU
- GPGPU Calculation Time
- GPU ->Data transfer time to host memory
During this time, the CPU is barely running (because DMAC is working hard).
I don't feel very happy even if I measure it.
clock
is this way, but the resolution is not very high, so GetProcessTime
would be good.
© 2024 OneMinuteCode. All rights reserved.