Closed pyt-hnu closed 7 months ago
so what happened?
Hi @hmaarrfk
One problem I found was that in function dma_to_device.c
, Whether there is an error in the total_time
. when time has units in seconds, he only counts the units in nanoseconds and ignores the units in seconds. Because the seconds and units in timespec
are separate.
rc = clock_gettime(CLOCK_MONOTONIC, &ts_end);
if (bytes_done < size) {
printf("#%d: underflow %ld/%ld.\n",
i, bytes_done, size);
underflow = 1;
}
/* subtract the start time from the end time */
timespec_sub(&ts_end, &ts_start);
total_time += ts_end.tv_nsec;
total_time += ts_end.tv_sec*1000000000; //Here is my extra code
/* a bit less accurate but side-effects are accounted for */
great thanks for the explanation
So am I right?
maybe. seems correct. I'm not sure. I haven't run this test myself in a while
When I used the test program in /tools, I found that the test results exceeded the theoretical bandwidth. and my test program is dma_test.sh, which called dma_to_device. (ubuntu 20.04 5.4.0-42-generic) PCIe3.0 line:x16
Below is my test result.