Download workloads/common/cpu_timestamps.cpp from lrh12580/UvmPinAsync: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/lrh12580/UvmPinAsync/resolve/main/workloads/common/cpu_timestamps.cpp
- Command line
-
hf download hf://lrh12580/UvmPinAsync/workloads/common/cpu_timestamps.cpp
-
curl -L -o cpu_timestamps.cpp https://huggingface.co/lrh12580/UvmPinAsync/resolve/main/workloads/common/cpu_timestamps.cpp
1.01 kB
| void startCPU() { | |
| struct timespec tv; | |
| if(clock_gettime(CLOCK_REALTIME, &tv)) | |
| printf("error clock_gettime\n"); | |
| startCPUTime = (tv.tv_sec * 1.0e9 + tv.tv_nsec); | |
| } | |
| void endCPU() { | |
| struct timespec tv; | |
| if(clock_gettime(CLOCK_REALTIME, &tv)) | |
| printf("error clock_gettime\n"); | |
| endCPUTime = (tv.tv_sec * 1.0e9 + tv.tv_nsec); | |
| //endCPUTimestamp1 = std::chrono::system_clock::now(); | |
| printf("CPU_Times,%lu,%lu,%lu\n", startCPUTime, endCPUTime, endCPUTime-startCPUTime); | |
| printf("Overlap_Times,%lu,%lu,%lu\n", overlapStartCPUTime, overlapEndCPUTime, overlapEndCPUTime - overlapStartCPUTime); | |
| } | |
| void overlapStartCPU() | |
| { | |
| struct timespec tv; | |
| if (clock_gettime(CLOCK_REALTIME, &tv)) | |
| printf("error clock_gettime\n"); | |
| overlapStartCPUTime = (tv.tv_sec * 1.0e9 + tv.tv_nsec); | |
| } | |
| void overlapEndCPU() | |
| { | |
| struct timespec tv; | |
| if (clock_gettime(CLOCK_REALTIME, &tv)) | |
| printf("error clock_gettime\n"); | |
| overlapEndCPUTime = (tv.tv_sec * 1.0e9 + tv.tv_nsec); | |
| } | |