diff options
Diffstat (limited to 'copy_experiments')
| -rw-r--r-- | copy_experiments/mon_cross_ctx_copies.cu | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/copy_experiments/mon_cross_ctx_copies.cu b/copy_experiments/mon_cross_ctx_copies.cu index dfccdfc..d9749e0 100644 --- a/copy_experiments/mon_cross_ctx_copies.cu +++ b/copy_experiments/mon_cross_ctx_copies.cu | |||
| @@ -3,7 +3,13 @@ | |||
| 3 | * (by default) and logs the times that pages are copied to the GPU. Supports | 3 | * (by default) and logs the times that pages are copied to the GPU. Supports |
| 4 | * monitoring copy progress from either the GPU or the CPU. All output times are | 4 | * monitoring copy progress from either the GPU or the CPU. All output times are |
| 5 | * converted to ns. | 5 | * converted to ns. |
| 6 | * WARNING: By default, assumes that GPU and CPU clocks tick at the same rate. | 6 | * Some assumptions: |
| 7 | * - GPU clock ticks at a constant rate | ||
| 8 | * - GPU clock ticks even while GPU is idle | ||
| 9 | * - Different contexts view the same underlying GPU clock | ||
| 10 | |||
| 11 | WARNING: By default, assumes that GPU and CPU clocks tick at the same rate. | ||
| 12 | * | ||
| 7 | */ | 13 | */ |
| 8 | #include "copy_testbench.h" | 14 | #include "copy_testbench.h" |
| 9 | #include "../task_host_utilities.cu" // Just for GetHostDeviceTimeOffset() | 15 | #include "../task_host_utilities.cu" // Just for GetHostDeviceTimeOffset() |
| @@ -46,7 +52,7 @@ static const int CPU_MON_DIVISOR = 50; | |||
| 46 | static const int GPU_MON_THREADS = 32; | 52 | static const int GPU_MON_THREADS = 32; |
| 47 | // If delay start is enabled on any thread, how great is the delay? | 53 | // If delay start is enabled on any thread, how great is the delay? |
| 48 | static const struct timespec DELAY_TIME = {0, 50*1000l*1000l}; // 50ms (use 30ms for GV100) | 54 | static const struct timespec DELAY_TIME = {0, 50*1000l*1000l}; // 50ms (use 30ms for GV100) |
| 49 | // Should each thread doing GPU monitoring check for GPU clock skew? | 55 | // Should each GPU-copy-monitoring thread check for GPU clock skew? |
| 50 | static const bool SKEW_CHECK = false; | 56 | static const bool SKEW_CHECK = false; |
| 51 | 57 | ||
| 52 | // Size of each copy to the GPU, in bytes | 58 | // Size of each copy to the GPU, in bytes |
| @@ -204,9 +210,9 @@ void* copy_thread(void* args_raw) { | |||
| 204 | fprintf(stderr, "GPU clock ran at rate %f of CPU clock (%f ticks GPU vs %f ticks CPU)\n", dev_diff/host_diff, dev_diff, host_diff); | 210 | fprintf(stderr, "GPU clock ran at rate %f of CPU clock (%f ticks GPU vs %f ticks CPU)\n", dev_diff/host_diff, dev_diff, host_diff); |
| 205 | } | 211 | } |
| 206 | 212 | ||
| 207 | cudaFreeHost(pinned_hostmem); | 213 | SAFE(cudaFreeHost(pinned_hostmem)); |
| 208 | cudaFree(devtimes); | 214 | SAFE(cudaFree(devtimes)); |
| 209 | cudaFree(devmem); | 215 | SAFE(cudaFree(devmem)); |
| 210 | 216 | ||
| 211 | return times; | 217 | return times; |
| 212 | } | 218 | } |
