-2
gettimeofday 또는 cudaEventRecord를 사용하여 루프 시간을 지정하려고합니다. 그러나 그들은 매우 다른 결과를보고합니다. 다음은 의사 코드입니다.cudaEvent와 gettimeofday는 크게 다른 시간을보고합니다.
// get time here (start)
while (..)
{
. ..
}
// get time here (stop)
// calculate time
// time = (stop.tv_usec-start.tv_usec)*1.0e-3 + (stop.tv_sec - start.tv_sec); or
// cudaEventElapsedTime(&time,start,stop);
나는 둘 다 동시에 사용하지는 않지만 각각 별도로 사용하므로 결과가 동일하지 않습니다. 또한 cudaEvent를 사용할 때 cudaEventSynchrosize (stop)를 호출했습니다. 감사.