summaryrefslogtreecommitdiffstats
path: root/copy_experiments/mon_cross_ctx_copies.cu
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2023-07-05 16:45:46 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2023-07-05 16:45:46 -0400
commitfa0c33d216f14fa6f81f177cc7098c7d8ae70286 (patch)
treef38ed3993c9f0039a58480ccadd2a60b7ed4eb00 /copy_experiments/mon_cross_ctx_copies.cu
parent717f5eaeb0e5ffbfe9372dbca041bd751c95410d (diff)
Comments and check for successful cleanup in mon_cross_ctx_copies
Diffstat (limited to 'copy_experiments/mon_cross_ctx_copies.cu')
-rw-r--r--copy_experiments/mon_cross_ctx_copies.cu16
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
11WARNING: 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;
46static const int GPU_MON_THREADS = 32; 52static 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?
48static const struct timespec DELAY_TIME = {0, 50*1000l*1000l}; // 50ms (use 30ms for GV100) 54static 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?
50static const bool SKEW_CHECK = false; 56static 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}