We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01e580d commit 3ad73adCopy full SHA for 3ad73ad
intermediate_source/pinmem_nonblock.py
@@ -159,7 +159,14 @@
159
160
161
def timer(cmd):
162
- return Timer(cmd, globals=globals()).adaptive_autorange().median * 1000
+ median = (
163
+ Timer(cmd, globals=globals())
164
+ .adaptive_autorange(min_run_time=1.0, max_run_time=20.0)
165
+ .median
166
+ * 1000
167
+ )
168
+ print(f"{cmd}: {median: 4.4f} ms")
169
+ return median
170
171
172
# A tensor in pageable memory
@@ -378,7 +385,7 @@ def pin_copy_to_device_nonblocking(*tensors):
378
385
# Add some text for labels, title and custom x-axis tick labels, etc.
379
386
ax.set_ylabel("Runtime (ms)")
380
387
ax.set_title("Runtime (pin-mem and non-blocking)")
381
-ax.set_xticks([])
388
+ax.set_xticks(strategies)
382
389
ax.legend(loc="upper left", ncols=3)
383
390
384
391
plt.show()
0 commit comments