diff options
Diffstat (limited to 'preemption_logger.cu')
-rw-r--r-- | preemption_logger.cu | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/preemption_logger.cu b/preemption_logger.cu index d93600e..89b348a 100644 --- a/preemption_logger.cu +++ b/preemption_logger.cu | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Copyright 2023 Joshua Bakita | 1 | /* Copyright 2024 Joshua Bakita |
2 | * Tool that tracks preemptions as discontinuities in GPU time and logs them. | 2 | * Tool that tracks preemptions as discontinuities in GPU time and logs them. |
3 | * | 3 | * |
4 | * The logged intervals are output to standard out as a CSV, with each row | 4 | * The logged intervals are output to standard out as a CSV, with each row |
@@ -92,8 +92,11 @@ int main(int argc, char **argv) { | |||
92 | if (!skip_conversion) { | 92 | if (!skip_conversion) { |
93 | // Note that this appears to almost always be 1.0 on recent GPUs | 93 | // Note that this appears to almost always be 1.0 on recent GPUs |
94 | d2h_scale = GetGPUTimerScale(0); | 94 | d2h_scale = GetGPUTimerScale(0); |
95 | // The following uses a subprocess for clock synchronization. Sketch? | 95 | InternalReadGPUNanoseconds(0, &host_s, &dev_ns); |
96 | GetHostDeviceTimeOffset(0, &host_s, &dev_ns); | 96 | if (host_s == 0 && !dev_ns) { |
97 | fprintf(stderr, "Unable to synchronize time with the GPU. Aborting...\n"); | ||
98 | return 1; | ||
99 | } | ||
97 | } | 100 | } |
98 | 101 | ||
99 | // Initialize GPU and CPU memory to store the intervals of execution | 102 | // Initialize GPU and CPU memory to store the intervals of execution |