summaryrefslogtreecommitdiffstats
path: root/testbench.h
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2023-07-06 11:45:59 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2023-07-06 11:45:59 -0400
commite415e282be53a3d8264b67d22b4b15b518f71099 (patch)
treee57cfc4b8333ed2109bc8ab8629ae5308102054b /testbench.h
parentb587ea88f62a207a18b6efa56025bc307e06d5ae (diff)
Add preemption_logger benchmark, make target, and fix d82c60c
Benchmark supports: => Spinning on-GPU until some number of preemptions have occured => Monitoring GPU scheduling by logging preempt and resume times => Logging the above as raw GPU, or converted CPU, times => Measuring launch overheads Also imports task_host_utilities.cu from cuda_scheduling_examiner as of commit 9fc0ca898ef64b82cbc3734c60405723650bc66f. This is needed for timing logic used in both preemption_logger and mon_cross_ctx_copies, thus the latter would not compile prior to this commit. Also adds a new testbench helper, and a .gitignore for binaries.
Diffstat (limited to 'testbench.h')
-rw-r--r--testbench.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/testbench.h b/testbench.h
index 28d7f77..5b47bd4 100644
--- a/testbench.h
+++ b/testbench.h
@@ -11,4 +11,7 @@
11 11
12#define s2ns(s) ((s)*1000l*1000l*1000l) 12#define s2ns(s) ((s)*1000l*1000l*1000l)
13#define ns2ms(s) ((s)/(1000l*1000l)) 13#define ns2ms(s) ((s)/(1000l*1000l))
14
15// Return the difference between two timestamps in nanoseconds
14#define timediff(start, end) ((s2ns((end).tv_sec) + (end).tv_nsec) - (s2ns((start).tv_sec) + (start).tv_nsec)) 16#define timediff(start, end) ((s2ns((end).tv_sec) + (end).tv_nsec) - (s2ns((start).tv_sec) + (start).tv_nsec))
17#define time2ns(time) (s2ns((time).tv_sec) + (time).tv_nsec)