Skip to content

Commit 1a654f1

Browse files
committed
mm target -> matul for consistency, reduce progress report log spamming of setup.py
1 parent 354e76a commit 1a654f1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ run_setup: check-python
2727
all: dawnlib check-clang check-linux-vulkan lib pch
2828
cd examples/gpu_puzzles && make build/gpu_puzzles
2929
cd examples/hello_world && make build/hello_world
30-
cd examples/matmul && make build/mm
30+
cd examples/matmul && make build/matmul
3131
cd examples/physics && make build/physics
3232
cd examples/render && make build/render
3333

@@ -66,7 +66,7 @@ clean:
6666
read -r -p "This will delete the contents of build/*. Are you sure? [CTRL-C to abort] " response && rm -rf build/*
6767
rm -rf examples/gpu_puzzles/build/*
6868
rm -rf examples/hello_world/build/*
69-
rm -rf examples/matmul/build/mm
69+
rm -rf examples/matmul/build/matmul
7070
rm -rf examples/physics/build/*
7171
rm -rf examples/render/build/*
7272
rm -f build/gpu.h.pch

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ def get_os_name():
2222

2323
def download_file(url, output_filename):
2424
total_downloaded = 0
25+
total_truncated = 0 # only print download progress every 2MB to avoid spamming logs
2526

2627
def report_progress(block_num, block_size, total_size):
2728
nonlocal total_downloaded
29+
nonlocal total_truncated
2830
total_downloaded += block_size
29-
print(f"\rDownloaded {total_downloaded // (1024 * 1024)} MB", end="")
31+
if total_downloaded // (1024 * 1024) > total_truncated:
32+
total_truncated = total_downloaded // (1024 * 1024)
33+
if total_truncated % 2 == 0:
34+
print(f"\rDownloaded {total_downloaded // (1024 * 1024)} MB", end="")
3035

3136
try:
3237
ssl._create_default_https_context = ssl._create_stdlib_context

0 commit comments

Comments
 (0)